-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
KinematicBody player with RayShape does not respect snap argument in move_and_slide_with_snap() #34098
Comments
@DenisBelmondo Can you test in 3.2 beta 3? Possibly related: #33864 |
I already tried, the project has the same behavior in 3.1.2-stable and 3.2 master. |
I have this issue too, circumventing the problem by applying tons of gravity when the player is |
Can still reproduce in 3.2.4 beta 5. As a side note:
This can be fixed by applying gravity only when |
These changes improve Rayshape behavior for Godot Physics 2D and 3D when using move_and_slide with and without snapping. Kinematic margin is now applied to ray shapes when handling snapping collision tests and separation raycasts to help getting consistent results in slopes and flat surfaces. Recovery is calculated without the margin and a depth of 0 is still considered a collision to stabilize results when on flat surface. Recovery is split based on the amount of shapes to fix cases where multiple rayshapes would cause the body to bounce. Fixes godotengine#34098 Fixes godotengine#34663
These changes improve Rayshape behavior for Godot Physics 2D and 3D when using move_and_slide with and without snapping. Kinematic margin is now applied to ray shapes when handling snapping collision tests and separation raycasts to help getting consistent results in slopes and flat surfaces. Recovery is calculated without the margin and a depth of 0 is still considered a collision to stabilize results when on flat surface. Recovery is split based on the amount of shapes to fix cases where multiple rayshapes would cause the body to bounce. Fixes godotengine#34098 Fixes godotengine#34663
notably, enabling |
Hang on a second. Is there a fix for the production 3.x branches for this? |
For info, I'm planning to try and backport some of the fixes to 3.x and it will probably include this issue. |
So be it. So why is the issue closed then? It has been reported as an issue for 3.2+. Our experience on 3.x with this is that snapping is a gamble. Make a sinusoid terrain. Have a character 128 pixels hight, 64 pixels to the terrain. Make it move. Make the snap 70 pixels, then 128 pixels, then make it 1024 pixels. You will be fascinated by the random jumping of the character. |
@oeleo1 Issues are closed when fixed in a future version, whether it's the current master or backported to 3.x, and the main development focus is 4.0 at the moment. The only exception is regression bugs specific to 3.x. But as mentioned before, an issue like this one will be likely fixed in a separate PR for 3.x, it's just going to take more time to do it in a way that doesn't break compatibility. |
Godot version:
3.2 dev
OS/device including version:
Windows 10 x86_64
Issue description:
KinematicBody no longer snaps as per the snap argument in move_and_slide_with_snap(), as evidenced by the fact that the player "hops" when walking down slopes.
Steps to reproduce:
Download the provided project in the zip file, run test_map.tscn, walk up the red slope immediately in front of the player, descend it, observe the player "hopping" as they descend.
Minimal reproduction project:
kinematicbody-demo.zip
Additional notes:
There are two types of player scenes in the project. One has the 3D equivalent of the RayShape setup as seen here (which does stop the player on slopes properly and prevents them from incurring more effort when walking up them as of 3.2) and the other (called "PlayerNoRayShape") which does respect the snap argument (But also slides down slopes even when stop_on_slope is true unlike ordinary Player. May submit this as a separate issue.)
To observe the behavior of PlayerNoRayShape, replace the player scene with a player_no_rayshape scene in test_map.tscn and place it in front of the red slope.
The text was updated successfully, but these errors were encountered: