- Home /
OnMouseOver with multiple colliders
I have an object with 2 children : Radius and MouseDetect. They are both sphere colliders. MouseDetect is smaller than radius, and I need to detect whether the mouse is over MouseDetect. OnMouseOver doesn't work in that case (only the outer sphere collider triggers even though both spheres are Triggers).
I tried raycasting with a layer mask on the outer sphere, but it masks the whole object.
Any advice would be greatly appreciated.
Thanks!
Answer by spinaljack · May 23, 2010 at 10:11 PM
Setting the two colliders to different layers should let you pick the correct one with ray casting. You can also do it with tagging and physics raycast all but the layers option is faster. (You have to write your own mouse over code in both cases)
Your answer
Follow this Question
Related Questions
Can't click gameobject when over another trigger? 1 Answer
Can one click trigger 2 colliders? 1 Answer
Collider & Trigger on same object 1 Answer
Trigger via Collider 1 Answer