2 kinematic bodies not colliding when 1 of them is not moving

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

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?

Nodes:

when both objects are moving

Player Moving

when one object stops moving

Player not moving

:bust_in_silhouette: Reply From: BraindeadBZH

Have think about deactivating “Can Sleep” property?

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

mshka | 2019-07-14 17:18

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

BraindeadBZH | 2019-07-14 20:45

:bust_in_silhouette: Reply From: Daniel Tebbutt

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.

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.

Paweł Wolak | 2019-11-07 02:41