Unity3D - Set a (foreground) UI layer which ignores mouse clicks? - unity3d

I'm currently writing up a UI-Centric game, and I've added a small image overlay over some elements on screen. However, the problem is that now I can't click any buttons behind this overlay image, regardless of transparency etc.
Just to chance it, I set up a new layer called "noUIclick" and set it to ignore every other layer under physics settings - long shot I know, but no dice. Tried also simply swapping to 3D view and moving the overlay image back on the z-axis.
Is there any easy way to set a layer for UI components which will entirely ignore/allow for passthrough of mouseclicks onto the buttons in the background?

On the Image component, uncheck raycastTarget.

Related

Unity UI panel transparency

I'm working on my game and I want to add an inventory type system, when I added the panel it was a little transparent while the one in the video was watching was not. I didn’t see any setting for transparency in the Unity inspector for both the canvas and the panel. The UI mode is an overlay
I didn’t try much other than clicking all the check boxes, and I was excepting for the up to be a solid color.
If you have a Canvas Group in your hierarchy, it can come from here (Alpha property).
I needed to go to colors and slide this slider all the way up or down (the slider you need to change)

Particles are in front of UI elements in unity

So all i'm looking for is simple. I want the UI elements such as Buttons/Logo/..etc to be in front any particle effects in the Canvas.
In the answer Here someone suggested to add a canvas component to each and every UI element I want to show in front of the particles and that work somehow the only problem in this way the buttons won't click at all.
All elements are on the default sorting layer including the particles object and the camera.
Is that hard to do that?
Please help.
set "Order in layer" of Particles to 0 and UI elements to 1 or a better way of doing this is to go to add new layers, create a foreground and background layer, set foreground to 1 and background to 0 and then change from the default layer to which ever you want in front or back.
My solution was to change the material I was using in the particle system. Change "Sprite-Default" to a material with "Rendering Mode" Opaque and "Shader" to "Standard".

Unity2D layering multiple canvas'

I have two canvas' set up for my project, one to act as a background and one to hold foreground UI elements. Originally they were set to world space, and I had no problems, but now I am optimizing my game, I must change the space so they adjust to mobile phones. How can I design the canvas' so that one acts in the background and the other in the foreground? I have tried changing the z-pos and other quick fixes I found online but none have worked.
Ok, you have background canvas, sprites and foreground canvas, and background canvas should be behind everything including sprites.
The idea is to render at first only background with one camera, and then render everything with another.
To do that, we should:
Add a layer for background canvas. Change layer of background canvas and children to that layer.
To add a layer, select any gameObject and in top of the inspector you will see:
Click on a dropdown list labeled "Layer" and select "Add Layer". Then create new layer and give it a name:
Select your background canvas and change layer for it and its children. When adding gameObjects, keep in mind that if you add them to background canvas, their layer must be the same as the layer of canvas, otherwise they will be rendered by the wrong camera.
Disable that layer in main camera's culling mask.
Now the camera should no longer render background UI, and it will disappear in the game view.
Add a camera for rendering background UI.
Cameras with higher depth render on top of those with lower depth, so we should set its depth to less than depth of main camera. We should also set its culling mask to only layer for background UI, otherwise all objects on scene will be rendered twice. Copy other setting from main camera. Set main camera's clear mode to Don't Clear or Depth Only to prevent it from erasing background.
Set mode of the background canvas to Screen Space - Camera and drag newly created camera into field "Render Camera" there.
It should work now.

Unity sorting layer not worked

I am creating my first 3D game, it including a HP bar will always show on the screen with FPS camera.
My HP bar is an image and the background of this game is a 3D house.
The problem is that my HP bar will penetrate the wall of house sometimes.
I have tried some solution such like using sorting layers, setting HP bar as higher layers in sorting layer and setting the 3D house as lower layer, but it doesn't work.what's the problem here?
For HUD, you should use unity UI components and make sure the canvas is set to Screen Space Overlay, you dont have to use layers as this will always be displayed in front of the camera.
https://docs.unity3d.com/Manual/class-Canvas.html
You can use screen space overlay to fix your problem.Screen space overlay render mode will enable your UI elements to be always render in front of the 2d or 3d objects present in the scene.Hope this fixes your problem.

How can I create a tile, overlay for a scene in Cocos2d?

I'm new to Cocos2d, but I can't seem to find the answer to this. I want to add an image that is mostly transparent as an overlay to my application. The image is overlayed on the app, and does not respond to screen taps. All gestures should "pass through" to the application.
The overlay image should actually be tiled. It's a small image that should repeat both horizontally and vertically.
How can I do this? In fact, this is an overlay that I would like to display for the duration of the entire application-- not just one specific scene. Is there a simple way to do this?
The point of my overlay is that I'd like to create a pseudo-scan line affect for a game which has an "8-bit" tone. The scan lines will be generated by applying the overlay to the game. The overlay is non-interactive and should always exist. So, this isn't a "tile based game", but I do need a tiling affect for this functionality.
You should be able to create a layer in each scene, set the zOrder to something large so that it overlays everything else, and set its isTouchEnabled attribute to NO. You can then add whatever you want to the layer, which could be your patterned image. To change the alpha, just set the opacity attribute of your image. The only issue that I can foresee is that the overlay might disable touch events for layers below it.