- Home /
EventSystem Pointer going through objects
Following scenario: i have a lot of world space canvasses that with proper camera positioning and angle can have the following order:
cam -> canvas1 -> canvas2 -> canvas3
canvas1: image and button components
canvas2: panel, text and button components
canvas3: just image component
where only c1 and c3 overlap the eventsystem shows the image on c1 in the pointerEnter section as is correct.
in places where c1 and c2 overlap, the eventsystem recognizes the elements on c2 behind c1 and if the user clicks the action on the button on c2 is performed.
how do i get c1 to block this if it is in front?
Answer by tormentoarmagedoom · Mar 28, 2018 at 02:23 PM
Good day.
Maybe with Raycast. Do always a raycast, and if detect 2 canvas, use vector3.distance to know which is in front (between you and the other)
Your answer
Follow this Question
Related Questions
How to assign Evensystem to a specific canvas to work. 0 Answers
Check UI panel touched after OnEnable()? 0 Answers
Canvas-prefab elements are not interactable 2 Answers
Photon give priority to Canvas Input (Event System) 1 Answer
Canvas Graphics raycaster, prevent 2d and 3d physic raycast 0 Answers