- Home /
Question by
ILLUSION2006 · Jul 02, 2020 at 06:17 PM ·
ui2d gametouchpanel
Make only certain UI elements block raycast/touch
I have a panel which turns on and off I use this to make it block raycast/touch - if (EventSystem.current.IsPointerOverGameObject()) return; - The problem is that this code also doesn't allow raycast to be passed through the canvas. How to I modify/write code so it only blocks raycast when ONLY the panel is in front.
Comment
Answer by ILLUSION2006 · Jul 02, 2020 at 06:27 PM
Ok, so I figured it out. Go onto canavas and from the Canvas Group component uncheck blocks raycast. Then go to panel and add the canvas group component. Check all the options, block raycast, interactable and ignore parent groups.
Answer by IsouEU · Mar 09 at 09:07 PM
still don't working for me, but now i can click in the image(not looking for lol) thankyou anyway