Moving Platforms

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By holhow
:warning: Old Version Published before Godot 3 was released.

Hello,

I’m very very new to godot.

I’m making a basic 2D platformer game. My main player is a kinematic body and I’ve just used the animation player to create a moving platform [static body]. Only problem is that my player does not move along with the platform when it jumps onto it.

I understand it is probably fixed with some code but I have a deadline for this project in the next 2 days and so I thought I’d ask anyone on here if they’ve already done it.

Thanks for any help!

:bust_in_silhouette: Reply From: PMurrayDesign

Check out the Kinematic 2D demo, that has a kinematic player and moving platforms, plus code to move you with them. You basically check to see if the player is colliding with a platform, and if they are, match their movement to the platform;

move(floor_velocity*delta)

Check out the demo script for a full example.