How do I add a dynamic collision box on my player?

Kinematic bodies should still collide with dynamic ones if the mask matches. The simulation might be unpredictable, though, because kinematic bodies are moved with set_position(). In your example above you should be ok I think, because the movement is so slow.

You can also set linear velocity on a kinematic body. Although this won’t make it move (like in vanilla Box2D) dynamic bodies react like it does if linear velocity is set. This helps interaction with dynamic bodies.

Update: Push a box, three ways:

Box Pushing.zip (2.6 KB)

3 Likes