-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Add properties to CharacterBody for more move_and_slide options #51027
Add properties to CharacterBody for more move_and_slide options #51027
Conversation
de2d8f1
to
222ef13
Compare
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.
Great work!
I haven't had time to do extensive testing yet, but I've left some comments on the code and documentation. There might be a bit more later when I get deeper into the math :)
e9ea589
to
9d136fc
Compare
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.
I've made another batch of review comments about details of the algorithm. You changes generally look great, my comments are mostly about making things a bit more readable and adding comments to help future contributors.
I still haven't done the regression tests I wanted to, I'll probably do it next week after porting some example projects to 4.0.
aeb71e4
to
e7d408a
Compare
Here are the tests I've made so far:
No regression spotted, everything seems to work well.
No regression. Possible issue: When setting motion on floor only (default
Constant speed works well.
Edit: After discussion with @fabriceci and more tests, it makes sense that it's a case not supported by default. We can actually get rid of Just for the record, here's a snippet of gdscript that can achieve something similar (before
No regression. Next I'm going to convert physics tests from https://github.com/godotengine/godot-demo-projects/tree/master/2d/physics_tests to 4.0 in order to do the last remaining regression tests. |
b7d823e
to
1bdef5c
Compare
I struggled a lot on this. Note: there was a small problem in the test project you used, the gravity was not applied on the ground. |
1bdef5c
to
73dd986
Compare
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.
Just a few last things to adjust, otherwise it all works perfectly well!
Edit: Also tested with physics tests converted to 4.0, and no regression spotted on character controller tests.
(godotengine/godot-demo-projects#638)
73dd986
to
7a37ccd
Compare
7a37ccd
to
c6666cc
Compare
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.
Amazing work, thanks!
Thanks! |
Implementation of the proposal 2982 that aim to fix and add more options to move and slide in 2D, see the proposal for details.
I made the following project https://github.com/fabriceci/move_and_slide_4.0 to test this PR easily.