You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just for reference, I am talking about 3D physics here. I have not looked into any changes on the 2D side of things.
CharacterBody is supposed to replace KinematicBody, however I don't think it's a good replacement:
Snapping movement is more complex than regular movement and KinematicBody handled this by separating them into two different methods. I don't think merging the snapping behavior into the regular move_and_slide() was a good way to handle this.
Switching move_and_slide() args to object properties means that a call to move_and_slide() now takes many more lines of gdscript to set all of the arguments. I believe this was done for the case where the movement script is simple enough to only need one call to move_and_slide() with no varying arguments (like the template script).
For some reason, there is a difference between velocity and the "real velocity". I believe this was done for snapping movement on slopes, however now that there is no separation between snapping and non-snapping movement, this has to be worked around for non-snapping movement.
In general, CharacterBody seems to lean towards making movement scripts as quick and easy to create as possible, and while that's valuable, the flexibility and simplicity of the old KinematicBody should not have been sacrificed to achieve that.
I believe that KinematicBody should have been kept as it was and CharacterBody should have been made as separate class, extending from either PhysicsBody or KinematicBody.
This was discussed some in the pull request where the rename to CharacterBody happened:
My biggest fear with renaming "KinematicBody" to "CharacterBody" is that a kinematic body can be used as much more than characters.
Exactly, that's why I proposed not to rename it, but to create an extending node(CharacterBody) and move its utility methods in there.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Just for reference, I am talking about 3D physics here. I have not looked into any changes on the 2D side of things.
CharacterBody
is supposed to replaceKinematicBody
, however I don't think it's a good replacement:KinematicBody
handled this by separating them into two different methods. I don't think merging the snapping behavior into the regularmove_and_slide()
was a good way to handle this.move_and_slide()
args to object properties means that a call tomove_and_slide()
now takes many more lines of gdscript to set all of the arguments. I believe this was done for the case where the movement script is simple enough to only need one call tomove_and_slide()
with no varying arguments (like the template script).velocity
and the "real velocity". I believe this was done for snapping movement on slopes, however now that there is no separation between snapping and non-snapping movement, this has to be worked around for non-snapping movement.In general,
CharacterBody
seems to lean towards making movement scripts as quick and easy to create as possible, and while that's valuable, the flexibility and simplicity of the oldKinematicBody
should not have been sacrificed to achieve that.I believe that
KinematicBody
should have been kept as it was andCharacterBody
should have been made as separate class, extending from eitherPhysicsBody
orKinematicBody
.This was discussed some in the pull request where the rename to
CharacterBody
happened:Beta Was this translation helpful? Give feedback.
All reactions