- Home /
Question by
spaceshooter · Feb 14, 2011 at 01:51 PM ·
collisiononmousedown
Passing OnMouseDown to other Colliders
I have an area, which is defined by a Sphere Collider. Inside this area are other objects. I'd like the player to be able to click on the objects within the sphere.
The problem I am having is that the Sphere Collider is taking the OnMouseDown() call, is there a way to have it ignore and pass the event down?
Comment
Best Answer
Answer by jonas-echterhoff · Feb 14, 2011 at 02:02 PM
If you set the GameObject's layer to IgnoreRaycast, you should not get any mouse events for it.
Answer by JGeorge · Feb 14, 2011 at 02:01 PM
Use layers. You can give custom layer names to your objects, and then ignore certain layers within a raycast.