I have this hierarchy (objects as sprites with colliders):

  • object 1 as parent
  • object 2 can be opened from object 1
  • object 3 can be opened from object 2

The thing is I have many objects like this in my project that are nested and I want to prevent users from clicking through sprites. Is there a more efficient way to do this? Any other way than manually adjusting every objects Z position in the inspector?

enter image description here

  • 1
    \$\begingroup\$ There are many different ways to handle mouse input in Unity. Which one are you using? Are those canvas elements of spatial game objects? \$\endgroup\$ – Philipp Jun 29 at 10:04
  • \$\begingroup\$ I am using physics 2d raycast for my inputs. Not actually canvas elements but 2d sprites. \$\endgroup\$ – tcg Jul 15 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.