Hello! I am still a beginner at Godot and have been learning a lot from courses, but recently I’ve been running into a problem. I’m trying to make a point and click adventure and started with the movement functionality. I tried different kinds of code from different tutorials and the lessons I’ve been following, but I’m having a hard time getting something solid. With the way the code is now the character gets pushed to the mouse position, but he keeps going. Any advice will be a huge help! Here is my code currently:
Last 2 lines in your function make no sense, you can remove them as they have no effect.
You need to store the mouse global position at the moment of the click as a class member variable and check the distance of your character’s global_position to that clicked position every frame. When the distance is below some threshold, you can set the velocity to Vector2.ZERO to stop the movement.