Rigidbody and raycasting

I have a little shuttle with interactive cockpit. If there is no rigidbody, attached to a shuttle, all buttons working correctly. But attaching rigid to a ship let buttons ignore raycasting (I think so).
Buttons are childs of shuttle. Every button has collider and script, where function OnMouseDown() sends a some signal to shuttle’ script.
What should I do to shutdown that problem? (It’s so negative influence of rigids to all my completed work…)

By simply taking a look at the Unity Script documentation, there is a layerMask argument that you may be able to make use of.

I know about layerMask. But there is no ray that I defined. It’s just function OnMouseDown() on every button. Or I can define layermask for it?

I know about layerMask. But there is no ray that I defined. It’s just function OnMouseDown() on every button. And it does not works if button is child of some object with rigidbody. It still on Default layer, layer not change.

rigidbodies don’t interact with RayCasts
What a mess? I have tested raycasting on rigidbody, it works! It does not works on childs of rigidbody…

Ok, I get it (maybe). And how to let it working? Take a situation: We have a plane, that has rigid and collider. Also we have one button, that is child of plane. It has collider only. And how to press that button using OnMouseDown() or same func? I dont believe that its impossible.

Thanks, thanks… I have wrote my own “OnMouseDown()” func that works anyway. Relying to own hands is better way to get success.