So I’m trying to make a game like Space Invaders, but with mouse control, and I’m stuck. I’m trying to make the main object follow my mouse with some delay to prevent it from following the mouse instantly so I made this script:
Now it works perfectly, but the main problem is that when the object reaches the mouse position, it starts randomly vibrating/bouncing. I tried to solve it by checking the magnitude and set the velocity to 0, but that made the movement laggy and weird when the object close to the mouse position. I would be happy for any suggestions on how to solve this problem! Thanks in advance
Thank you very much for the quick reply! I tried it, and it worked. However, there is one issue: the ship becomes slower when it gets closer to the mouse point but I will try to fix it by myself.
Thank you very much for pointing me!