Rigidbody OnMouseDown

Hello, everybody

I have a question:

I have a Rigidbody in the GameObject,

GameObject has a child GameObject,

So how does child GameObject receive the OnMouseDown event?

Thanks

–jisekai

For non GUI elements, a collider is required to receive OnMouseDown message.

thanks,the GameObject and the child GameObject are two cubes,They have the box collider already!

If the parent GameObject add the Rigidbody, but the child GameObject doesn’t add it, then the child can not receive the Onmousedown events.

i don’t want to add the Rigidbody to the child GameObject

You misunderstand something, the rigidbody is not used to make available the OnMouse messages, a box, sphere collider, etc, is ! So you don’t need to add rigidbody to the child.

But I need to add the Rigidbody to the parent cube, so the child cube will not be able to receive the OnMouse message.

of course, both the parent and the child cubes already have the colliders

http://forum.unity3d.com/viewtopic.php?t=60502

You sure ?

there are some others met the same problems…it seems i should turn to some other ways to solve it…

Thankyou AkilaeTribe ! :slight_smile: