The 0.05 value is basically an error margin for how close your player needs to be to the target before it can stop moving. If your character is moving more than that distance every frame, it may overshoot, go back, and repeat this infinitely. So you just need to choose a value that’s a little larger than the distance the player moves each frame. In this case, 0.5 seems to solve the problem.