How to improve this RigidBody - KinematicBody interaction? (solved)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Qcaria


I am creating a small project in which a KinematicBody platform (controlled by the player) has two rigid bodies stacked on top.

However, when I move the platform on the horizontal axis, the rigid bodies start overlapping and even passing through the platform.

I append two images to depict this:
The project just started running and everything is as expected

In this second image I've moved the platform slightly to the right, and the two bodies have started to overlap and go through

I’ve tried disabling infinite_inertia in the platform, but the same happens.
Any ideas on how to improve this interaction?


:bust_in_silhouette: Reply From: Inces

Images don’t load.

It is possible, that physycs engine will not properly set collisions between rigid and kinematic bodies. What propably happens is kinematic platform moving by overriding its global_position and Rigid bodies falling with gravity force into kinematics collision shape. I would suggest to make platform a RigidBody also, but with Kinematic mode ( There are 3 modes of rigid bodies - rigid, static and kinematic ). If You can’t do this You may eventually tweak mass/gravity of rigidbodies or make kinematic collision shape thicker, with big margins.

Thanks a lot for the answer. I think that the problem is related with the stacking-bodies bug in godot, and I was able to solve it by increasing the physics fps to 180.

Qcaria | 2021-10-03 21:01