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
Title sums it up, I just found the inconsistency annoying when using those functions. It might be problematic to change it due to backwards compatibility though
The text was updated successfully, but these errors were encountered:
EeroMutka
changed the title
move_and_slide takes in velocity, while move_and_collide takes in position offset
move_and_slide() takes in velocity, while move_and_collide() takes in position offset
Jun 24, 2019
I agree that it's confusing that the two move_and_* methods have a completely different API: move_and_slide expects velocity and returns the modified velocity, move_and_collide expects an offset and returns a KinematicCollision2D.
In Godot 2 there was only move, which behaved like move_and_collide. move_and_slide was then added, which uses _move internally (which is what move_and_collide binds to).
I find that the KinematicBody[,2D] move API is pretty cumbersome overall, and I hope we can refactor it for 4.0 to be more intuitive and convenient to use (especially regarding the many parameters passed to move_* methods). Currently it's quite inconsistent due to seeing several iterations of improvements while trying to preserve compatibility.
Title sums it up, I just found the inconsistency annoying when using those functions. It might be problematic to change it due to backwards compatibility though
The text was updated successfully, but these errors were encountered: