0 votes

Hi there Godot community!

I'm playing around with the move_and_slide method on the KintematicBody2D node, and have stumbled upon some weird behavior. I made a Tilemap with a slope in it. The collision is a ConvexPolygonShape2D. When my player, which is a KinematicBody2D, moves up a slope, it kind of jumps up in the air. Here is a video to show it:

Here is what I think what happens: the player gets a horizontal and a vertical speed, because it has to move up the slope. When you stop moving, velocity.x becomes 0 but the velocity.y remains so the player seems to jump.
Code for the player is this:

Thank you in advance for helping me! It's been fun toying with this engine.

in Engine by (12 points)
edited by

I may not know a lot about the engine, and I may be crazy, but what if, when your character is on a part of the slope, jump and is_on_floor() (line 19 on the pastebin) gets fired off?

Thanks for replying!

It shouldn't fire because jump is only true if the jump button is pressed, which I'm not doing.

same behavior in 2.1 and same for a RigidBody2d. They just jump.

Please log in or register to answer this question.

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.