How to disable moving platforms affect jump height in a 2D platform game

Godot Version

4.3

Question

I’m using an AnimatableBody2D in combination with a Path2D to create moving platforms, and it works fine. The only problem is that when my character (CharacterBody2D) jumps on the platform(sets velocity.y = -200 upon pressing the jump key). If the platform is moving up or down, it affects the jump height. When it’s moving up, the character jumps very high, and when it’s moving down, the jump height becomes very low.

I’m expecting a constant jump height.

I tried replacing AnimatableBody2D with CharacterBody2D, and I still have the same issue. Replacing it with StaticBody2D causes the character not moving with platform.

Try set your on_leave property to add_upward_velocity

image

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.