Gameobject joined to rigidbody without rigidbodys interaction.

At first sorry for my bad english…
I have gameobject which is joined to my player’s rigidbody and what should I do to gameobject’s rigidbody not interact with player’s rigidbody when I want to have rigidbody component on both gameobjects?

You’ll want to use “Layers” to determine which Game Objects should interact physically. Once you have assigned each of these Game Objects to a layer you can enable/disable the collisions of those objects in Project Settings > Physics.

More information here: https://docs.unity3d.com/Manual/LayerBasedCollision.html

1 Like

That isn’t working. I mean that if i change mass of the gameobject then that mass will not interact with my player.

What you’re saying doesn’t make sense. I would try to be more specific. Firstly, you’re not stating whether you’re using 2D or 3D physics which is very important. Secondly, a GameObject has no concept of Mass so you’re saying that you change the Rigidbody or Rigidbody2D mass but this has nothing to do with what you asked and doesn’t change whether Rigidbody(2D) interact.

Finally I would state clearly what you mean by “interact”. Presumably you mean that they collide and have a collision response? Also, what do you mean by “joined”? Using a Joint? Again, your words are being vague. Try to be specific about what you want.

Whether two Rigidbody(2D) & attached Collider(2D) collide is indeed set-up using the Layer Collision Matrix as posted above. Go to the Project Settings and set the Layer Collision Matrix for the Layers you’re both set-up and assign the the GameObject in question. Note that there are separate project settings and therefore collision matrix for 2D and 3D.

You can stop them colliding there. Note that if you are indeed using Joints then joints have their own override on whether jointed (joined) Rigidbody(2D) can collide. Again, this is slightly different if you’re using 2D or 3D joints.