-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
[3.x] Backport KinematicBody move_and_slide and move_and_collide fixes #50495
[3.x] Backport KinematicBody move_and_slide and move_and_collide fixes #50495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, otherwise seems good to go.
Make sure the direction of the motion is preserved, unless the depth is higher than the margin, which means the body needs depenetration in any direction. Also changed move_and_slide to avoid sliding on the first motion, in order to avoid issues with unstable position on ground when jumping. Co-authored-by: fabriceci <fabricecipolla@gmail.com>
* Safe and unsafe motion are calculated by dichotomy with a limited number of steps. It's good for performance, but on long motions that either collide near the beginning or near the end, the result can be very imprecise. * Now a factor 0.25 or 0.75 is used to converge faster when this case happens, which allows longer motions to get more accurate collision detection. * Makes snap collision more precise, and helps with cases where diagonal collision on the border of a platform can lead to the character being stuck. Additional improvements to move_and_slide: * Handle slide canceling in move_and_collide with 0 velocity instead of not applying it. * Better handling of snap with custom logic to cancel sliding. * Remove small jittering when using stop on slope, by canceling the motion completely when the resulting motion is less than margin instead of always projecting to the up direction (in both body motion and snap). Co-authored-by: fabriceci <fabricecipolla@gmail.com>
38fa5a7
to
beeebb4
Compare
@akien-mga Thanks, it's rebased. |
Thanks! |
Would it be possible to consider this for an update to |
Hi. I have a little platformer game. the player moves with move_and_slide_with_snap. it works fine with godot 3.3.3 and 3.3.2, but got problems with 3.4 b4. The problem is when the player is over a platform that moves from side to side, the platform moves, but the player do not. The platform is made with a tileset. The static body is made with the tileset to and moved with an animation player. Thanks |
@crapaam Hi! Please open an issue with a test project so someone can investigate the regression. |
Backport #49901 and #50063 to 3.x.
These two PRs together make both
move_and_collide
andmove_and_slide
more reliable and after running a lot of tests (see original PRs for details) I'm confident they won't cause major regressions.Co-authored by @fabriceci
Supersedes #49902