Peter Morris
Peter Morris

Reputation: 23234

How do I stop canvas reacting to mouse when obscured by a 3D object

I have my canvas in world space. I have a 3D cube partially obscuring a button on the canvas, but I am still able to operate the button by clicking on the cube.

Can I tell Unity not to let its UI react to parts that are covered by 3D game objects?

Upvotes: 0

Views: 72

Answers (1)

Gunnar B.
Gunnar B.

Reputation: 2989

On the respective canvas under Graphic Raycaster there is the point Blocking Objects. You can use this to have objects block the ui (either 2D or 3D or All). From my quick testing that should do what you want if you used this for your ui.

Upvotes: 3

Related Questions