Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Elayon |
I’m still getting acquainted with how physics and such are handled in Godot and I couldn’t find a way to move_and_collide() and stop when the KinematicBody2D reaches the position I want it to be at. For example, I want my body to move_and_collide(Vector2 (5, 0)) until position == Vector2 (50, 0) is true. This seems like it could be done with a simple if statement or while loop, yet I think there is an odd connection between move_and_collide() and the position of the body. How is it even calculated and how can I accomplish what I want?