-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 #2982
Comments
I agree with the concept and the proposed options. It's in phase with the plan for 4.0, and it's the reason why physics nodes have been reorganized to have a specialized node for characters (proposal #2184). Detailed comments about specific options:
Yes, this is a recurring demand and it was already on my radar. Probably disabled by default, but I'm not completely sure about that.
Sounds like a good idea. The current behavior does lead to situations that look buggy when climbing up slopes, so this should probably be the default behavior.
Seems useful as well, since there's currently no option to disable the effect of moving platforms (which also includes other characters) and that seems the most flexible way.
It is a known issue (godotengine/godot#20593). As commented in that issue, it could be done in user script, but with the new design an option would be great since it does seem like a common case. I would probably make it slide by default. Also as an alternative, it could be a threshold to allow for more flexibility (as proposed in godotengine/godot#20593 (comment)), so it would be allowed to slide past a certain angle and bump if the ceiling is flat enough. |
Same for 3D. |
About the:
This already exists with the
Why not make the 1.5º or maybe 2.0º as the default value of Another question, the |
The parameter
This proposal in only about adding/fixing things, all the current options remain. But FYI, as everyone doesn't know that, |
Cool! Nice work, man. |
Implemented by godotengine/godot#51027. |
Describe the project you are working on
A 2D platformer.
Describe the problem or limitation you are having in your project
They are weird behaviour with the current logic,
move_and_slide
is defined as such:This method allows beginners to build games that require "common" physics very easily, more than many engines, that's a gem. However I was not satisfied by the current behaviour and I tried to experiment to see what can be improved.
They are many issues with moving platform, as fixing those issues is useful in the current version, I will not describe what and why as I did a PR for that #50314
move and slide
makes a projection into the collision normal, so it moves and slide :) however it will change the velocity according to the projection and that will lead to bad behaviours.I have a lot of examples but here are few to illustrate the idea:
a)
If you walk into a slope the body will slowdown, however, to understand well, it's not the method that slowdown the body but the developer because we usually set the
x
component of the velocity.However if the slope is too steep,
move_and_slide
will increase they
a lot, and so, as the length of the velocity returned by the method will be bigger, the body will accelerate and will start to fly and the end of the slopeb)
The body accelerates on the ceiling which is not physically correct (this can also stop the motion as in the following gif):
As the velocity slide, this will block the motion sometime:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
For the logic, the idea is to no more change the velocity by the projection (see code for details)
I tried to list (and asked for feedbacks in few platforms) to see what options can cover the majority of the needs, here are the ideas I find relevant:
notes:
move_and_slide
, they are propertiesDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I made of POC of this proposal in GDScript:
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not in few lines and not easy.
Is there a reason why this should be core and not an add-on in the asset library?
it's core
GIF after this proposal
The text was updated successfully, but these errors were encountered: