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?

Use two cameras with different culling mask

  1. Create a new layer called “FocusLayer” for example

  2. Create two cameras :

  3. The first one :

    • Culling mask set to “Everything” except “FocusLayer”

    • Render order to -1

  4. The second one :

    • Culling mask set to “FocusLayer”

    • Render order to 0

  5. Every object, including Canvas must be in a layer you want except “FocusLayer”

  6. The object you want to focus must be in the layer “FocusLayer”