Why all objects are sliding? Concave polygon collision shape in godot 3

Viewed 224

I have a plane mesh. I just click on mesh -> create trimesh collision sibling
Then, I have a collision shape (concave polygon) and if i adding kinematicBody3d, or StaticBody3d, or RigidBody3d, etc. These objects are sliding (moving) on a surface (or not)

that

added object:

and that

after a few seconds

and and that

but if I change collision shape mode, it will work correctly

2 Answers

If you don't want the trees to move. Ever. Make them StaticBody.

If you want them to be affected by gravity and allow other things to push them, then use RigidBody.

Since you are using RigidBody, I presume that is what you want. Which leads to the question: How to make a RigidBody that does not move until something pushes it? Add it sleeping. The RigidBody has a sleeping boolean property that you can set to true to disable its simulation.


By the way, you can also change the gravity_scale of the RigidBody. Which means you could add them with gravity_scale set to 0, and on the "body_entered" signal, set gravity_scale to 1.

And while we are at it, if using the "body_entered" signal is viable, another alternative to set the mode of the RigidBody to static, and change it o rigid on the "body_entered" signal. By the way, you would need to change mode using set_deferred or call_deferred because you cannot change mode while Godot is doing physics resolution (which is also when Godot sends the "body_entered" signal).

And yes, I know the RigidBody modes are confusing.

Related