Kinematic body and rigid body interaction in 3D problems

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

Hi, I’m trying to create a basic 3D game for a game jam to test my skills. It is a game where the player (a ball), a kinematic body, rolls around a platform that is a rigid body. the platform is balanced on a “pole” that is a static body. Points are won for how long the player can stay on the platform without falling off. However, whenever the player spawns onto the platform, it kinda glitches through and lands on the pole below. The platform then starts vibrating like it’s trying to free itself. The rigid body wasn’t interacting with the kinematic body as a solid object would. Does anyone have similar problems and how did you solve it?

:bust_in_silhouette: Reply From: kidscancode

When you move a kinematic body, by default the infinite_intertia parameter of the move method is true. This makes kinematics push rigids without taking physics into account. If you use false there, you’ll see the behavior you want.

See KinematicBody documentation for details.

For a more in depth discussion about this see:

Thank you a lot. I’ll go and try it out now. Thou, is it possible to give an example in code? Thanks.

7MEOW5 | 2020-04-06 23:55