P
P
Pragma Games2022-04-04 13:04:11
Unity
Pragma Games, 2022-04-04 13:04:11

Why are Raycasts not working in the UI?

There is a Canvas overlay on which a transparent Image is stretched with raycast target enabled (Needed to control the player through IDragHandler events, etc.). There is also a world space canvas that has a button. This button does not respond to clicks. How to fix it ? I think that this trouble solves the settings changes in the GraphicsRaycaster, but it doesn't work for me. BlockingMask changes are completely ignored. If you remove the raycast target from the canvas overlay on the image and put "UI World" in the Blocking Mask, then put layer "UI World" on the world canvas, raycasts will work, although this is not logical. Or am I misunderstanding something?

Overlay canvas
624ac09c54a0d394002690.png

settings World canvas
624ac11e434b8041694123.png

settings Camera settings
624ac12e548d7352883938.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question