-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
KinematicBody2D: move_and_slide_with_snap won't snap to slopes #26274
Comments
|
I confirm this, even with higher degree angle it is not snapping properly and the |
oh, @kaadmy is correct. If we change the |
@piratesephiroth Yeah it is snapping but the |
I can confirm |
you should upload a sample project then because as I wrote before, stop_on_slope is working fine here |
Ok. I created an sample project. Keep in mind, I'm not much of a programmer, so I apologize if it's badly written. Setting up the collision using a RayCast shape fixed the sliding issue for the most part (I thought this was only used to solve constant velocity up and down slopes?). Player sometimes comes off the slope, but that might be my bad code. But it seems using a RayCast shape causes issues with one way platforms. Maybe there is something I am missing? |
Godot version:
Godot 3.1 beta 61b41d6
OS/device including version:
Windows 10 x64
Issue description:
EDIT: it was just that
move_and_slide_with_snap
only snaps to floors and a limit for that is defined by thefloor_max_angle
argument. The default value is lower than 45º therefore it wouldn't detect the slopes in my example as floors.Thanks @kaadmy
move_and_slide_with_snap
only snaps to straight surfaces.It completely ignores slopes.
All these tests use Vector2(0,16) as
snap
Falling from a 16 pixels-tall tile onto a straight surface. Snaps fine.
Falling from a corner onto a slope, no snapping at all:
Steps to reproduce:
In a 2D Platformer setting, use
move_and_slide_with_snap
to make a KinematicBody2D slide off a ledge or corner. It will only stay on the floor if there's straight terrain inside the snap vector range.Minimal reproduction project:
move_and_slide_with_snap-slopeBug.zip
The text was updated successfully, but these errors were encountered: