-
-
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 slides with move_and_collide #45004
Comments
Nice one! output.mp4 |
hello @pouleyKetchoupp, I want to work on this can u help me where to start |
@Bhu1-V For sure! Your contribution would be welcome. At this point it's hard to tell how difficult it will be to solve, but it's not a problem for now. You can start with investigating the cause, share what you find and we'll find a good solution together if you need help. Here are a some starters:
Note: It would have to be adapted to If that doesn't work or the problem comes from something else we'll figure something out :) |
One curious detail is that it makes the KinematicBody2D slide again when detaching from the colliding obstacle. |
After observing it more carefully, I see that the problem comes from the way the kinematic body recovers from being stuck. You see that when the kinematic body moves to the right and enters the slope, it's always ejected out pretty much following the slope's normal. If the process is repeated multiple times, the body will appear to slowly slide up along the slope. So maybe the solution to make the body always move, collide and then stop is to make it always recover toward the position it was at before the collision, so that the undesired part of the movement gets undone properly? |
Godot version:
3.2.3 stable
OS/device including version:
Windows 10
Issue description:
Created from #18433 (comment) to have a separate issue for 2D.
KinematicBody2D
slides down the slope when usingmove_and_collide
. It can be reduced to a minimum setting to almost zero the safe margin in the kinematic body. But it's sliding anyway, only slower.Steps to reproduce:
Minimal reproduction project:
https://github.com/xphere/godot-testing/tree/slides-down-the-slope
(needs
Debug/Visible Collision Shapes
to be enabled)The text was updated successfully, but these errors were encountered: