0 votes

I have 2 kinematic bodies one is the player and is controlled by a move_and_slide function the other is a moving platform which is controlled an animation player - when the platform is moving and the player is not moving there is not collision but when the player moves the 2 bodies collide until the player stops

I have tried making the platform move by a move_and_slide, move_and_collide, along a path while attached to PathFollow and setting the animation player process mode to Physics but nothing worked

what I want to do is make the platform push the player body when moving or idle any idea how to achieve this?



when both objects are moving

Player Moving

when one object stops moving

Player not moving

asked Jul 14, 2019 in Engine by mshka (38 points)
edited Jul 14, 2019 by mshka

2 Answers

+1 vote
Best answer

A kinematic body will move or be pushed outside other colliders only at the time you are calling move_and_slide or move_and_collide. One possibility would be to make sure you are using the move method every frame, even if you are moving 0 distance. Then your kinematic body should be pushed out of the other objects every frame.

answered Jul 14, 2019 by Daniel Tebbutt (52 points)
selected Jul 15, 2019 by mshka

This is great answer. i was struggling to understand why my collisions are ignored and moving even by smallest amount in proper direction ensures that they are working.

0 votes

Have think about deactivating "Can Sleep" property?

answered Jul 14, 2019 by BraindeadBZH (1,020 points)

isn't the can sleep only on rigid bodies while both of these are kinematics

Yes, my bad, sorry then I don't know what's causing the issue.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.