Question by
isteffy · Sep 11, 2015 at 09:23 AM ·
2dclickonmousedownclickable
How to order clickable gameObjects that overlap? (2D)
Ex. If i have a Background and a character that stands on top of that Background. Both have scripts with OnMouseDown() events. I want the character to be the one who is clickable since he is standing on top of the background. Even when the character does render on top of the background is the only object that hears my OnMouseDown. If they dont overlap, both can be clicked just fine.
Comment
Best Answer
Answer by isteffy · Sep 11, 2015 at 01:05 PM
Don't use 2D colliders as there is no direct way to solve this, only timely workarounds involving Raycast. Switch these out with 3D Colliders and it will save you hassle in the end.