Open Exerionius opened 1 year ago
A side note:
Because of the same rename of KinematicBody2D
into CharacterBody2D
, the Kinematic character (2D) tutorial page became kinda confusing. It talks about kinematic bodies, but uses CharacterBody2D
in the code examples because KinematicBody2D
class no longer exists. Perhaps it makes sense to add some clarification to the paragraphs describing the differences between dynamic and kinematic characters by noting that dynamic characters are implemented using rigid bodies (already done), while kinematic characters are implemented using CharacterBody2D
.
Is there any clarifications on whether we need to multiply by delta or not anymore in 4.x?
People are still asking this question to this day: https://www.reddit.com/r/godot/comments/13c8h7r/help_needed_with_characterbody3d_move_and_slide/
You literally don't even have a place to "multiply by delta". You set the velocity
property in pixels/sec and call move_and_slide()
with no arguments.
There will always be questions about this because people really don't understand units or the difference between distance and velocity.
At least less likely to lead to questions than it was before. The old text which was intended to clarify the difference between the two methods is now obsolete and should be removed.
Edit: I'll submit a PR removing that "Tip" today.
You literally don't even have a place to "multiply by delta".
You pretty much do. When setting a velocity
property the first instinct is to multiply it by delta to make it framerate-independent, just out of a habit.
move_and_slide
is the only place in the whole engine where you don't need delta multiplication to make it framerate-independent. People who haven't used Godot 3.x will not know this, especially the ones coming from other engines where delta multiplication is a must. Omitting this info from the docs means leaving these users blind to the fact that you should not go with your habit of delta multiplication when dealing with this one special case called move_and_slide
, but should do it with everything else.
Also, the supplied example project from https://docs.godotengine.org/en/latest/tutorials/physics/using_character_body_2d.html ( https://github.com/godotengine/godot-docs-project-starters/releases/download/latest-4.x/character_body_2d_starter.zip ) has not been updated to 4.0 -i it still uses KinematicBody2d
Your Godot version: v4.0.beta11.official [91713ced8]
Issue description:
CharacterBody2D
'smove_and_slide()
function inconsistencyURL to the documentation page (if already existing):
A note that velocity is multiplied by delta automatically in
move_and_slide()
was removed from the function's docs in 4.0:but at the same time
Using Character2D
tutorial page still warns about it:Which one is true? Should it be multiplied by delta or was it changed in 4.0?