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

2D KinematicBody slides down slope with move_and_slide_with_snap #31097

Closed
Tracked by #45334
Spartan322 opened this issue Aug 5, 2019 · 3 comments · Fixed by #49901
Closed
Tracked by #45334

2D KinematicBody slides down slope with move_and_slide_with_snap #31097

Spartan322 opened this issue Aug 5, 2019 · 3 comments · Fixed by #49901

Comments

@Spartan322
Copy link
Contributor

Godot version: 3.1.1 Stable

OS/device including version: Manjaro Arch Linux (Linux 4.19.62-1 Kernel)

Issue description: When using the snapping feature of move_and_slide_with_snap it seems that there's some kind of artifact movement on slopes that occurs as a result of snapping. It does not happen when snapping is not used. Its not caused by the velocity of my 2D kinematic body directly, however it appears higher velocities of the body coming towards the slope (like gravity) does greatly effect the possibility of it happening. (beyond sliding) If stop_on_slope is false it appears to move faster but does not otherwise change the effect.

https://gfycat.com/klutzycorruptdeermouse

Steps to reproduce:
In a 2D platformer setup, while using move_and_slide_with_snap for movement, have the body snapped to a slope after falling.

Minimal reproduction project:
snapping_testing.zip

@Spartan322
Copy link
Contributor Author

Spartan322 commented Aug 9, 2019

It's definitely caused by the application of the collider's travel variable eventually getting applied to the global transform starting here, the best I could do to remove any visible aspect of it was rounding or steppifying (to a tenth) the application of the travel variable. I am still unaware of what the root cause is specifically but its fault somewhere in the collider returned from move_and_collide being inaccurate for this specific case for some reason.

@akien-mga
Copy link
Member

CC @madmiraal

@madmiraal
Copy link
Contributor

This is actually a problem with move_and_collide() that is used by move_and_slide_with_snap(); so it's the 2D version of #18433, which was identified by @xphere (comment), but unfortunately, unlike the 3D version, it is not solved with #35945.

@madmiraal madmiraal changed the title move_and_slide_with_snap's snapping transformation aggressively transforms the body downwards 2D KinematicBody slides down slope with move_and_slide_with_snap Oct 1, 2020
@akien-mga akien-mga added this to the 4.0 milestone Jun 30, 2021
@pouleyKetchoupp pouleyKetchoupp modified the milestones: 4.0, 3.4 Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants