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?

Nodes:

Nodes

when both objects are moving

Player Moving

when one object stops moving

Player not moving

in Engine by (38 points)
edited by

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.

by (52 points)
selected by

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?

by (1,045 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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.