Question by
aaronykng · Jan 23, 2017 at 09:17 PM ·
gameobjectcanvas
Make Canvas Image ignore specific game object.
I'm using Canvas to render a dark overlay (50% black) over everything onTouch of a specific GameObject. How can I make the Canvas avoid covering the GameObject too?
I'm basically trying to make the entire world darken except for the touched object. Is canvas the wrong way to go?
Comment
Best Answer
Answer by Hellium · Jan 23, 2017 at 09:19 PM
Use two cameras with different culling mask
Create a new layer called "FocusLayer" for example
Create two cameras :
The first one :
Culling mask set to "Everything" except "FocusLayer"
Render order to
-1
The second one :
Culling mask set to "FocusLayer"
Render order to
0
Every object, including Canvas must be in a layer you want except "FocusLayer"
The object you want to focus must be in the layer "FocusLayer"
Your answer