Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abrupt slide off on platform #17916

Open
vinf100 opened this issue Apr 2, 2018 · 5 comments
Open

Abrupt slide off on platform #17916

vinf100 opened this issue Apr 2, 2018 · 5 comments

Comments

@vinf100
Copy link

vinf100 commented Apr 2, 2018

Godot version:

3.0

OS/device including version:

Ubuntu 17.10

Issue description:

When using a kinematic body, when the body goes over the edge, instead of smoothly falling, it abruptly drops very quickly. This is unrelated to gravity, as changing the gravity constant has no effect. Also, when the character jumps, the gravity works as expected.

Steps to reproduce:
Have a platform with a collision box and a static body. Have a kinematic body, with a script for movement (using move_and_slide) and gravity, go over the edge of the platform.

Minimal reproduction project:

Test.zip

@Alexander-Alekseev
Copy link
Contributor

Alexander-Alekseev commented Apr 2, 2018

Just update your velocity after move_and_slide call:
velocity = move_and_slide(velocity, Vector3(0, -1, 0));

See also: http://docs.godotengine.org/en/3.0/classes/class_kinematicbody.html#class-kinematicbody-move-and-slide

Returns the movement that remained when the body stopped.

@vinf100
Copy link
Author

vinf100 commented Apr 2, 2018

Thank you, that works. Would it be possible to update the documentation on move_and_slide, and the the tutorial for a kinematic character? The documentation is not very clear, and the tutorial makes no mention of having to set the velocity to the return value.

@FeralBytes
Copy link
Contributor

FeralBytes commented Aug 4, 2018

@vinf100 please be more specific, what documentation do you want updated? As Physics Introduction Line 416 shows

velocity = move_and_slide(velocity, Vector2(0, -1))

How do you think the documentation should be changed?

@Calinou
Copy link
Member

Calinou commented Apr 27, 2020

Maybe this could be mentioned in the class reference to make it more obvious, but I'm not sure how exactly.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 3, 2021

Seems like overlooked physics issue
CC @pouleyKetchoupp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants