How to get raycast to ignore objects behind a panel
Hi there, super new to Unity.
Right now, I have a sprite that you can interact with using a raycast. However, I also have a panel that can open up over the sprite, but when I click on the panel the sprite still reacts to the raycast. Is there a way to block a raycast from interacting with layers beneath a top layer that I can open and close? Thank you!
Your answer
![](https://koobas.hobune.stream/wayback/20220612122711im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make an object move to the direction in which the user faces using vr gaze interaction? 1 Answer
onmouse over UI pop up help please 0 Answers
Why are my Physics.RayCast not showing the collsion with the Ground? 0 Answers
Destroy instatiate object on trigger enter / collision,destroy instantiate prefab on trigger enter 0 Answers
Mouse click doesnt seem to be hitting the right collider 1 Answer