[SOLVED] Object Slowly Following Mouse

Version: 1.19.3

I am having trouble making the code for an object slowly following the mouse.

yourClip.x +=(mouseX-yourClip.x) / speedFactor;
yourClip.y +=(mouseY-yourClip.y) / speedFactor;

should give you a clip that follow your mouse.
The closer the clip gets to mouse position the slower it moves.
Higher speedFactor will result in a clip moving slower

if you want clip constant speed it’s a little more tricky but one simple workaround could be:
mouseX >= yourClip.x ? yourClip.x+=clipSpeed : yourClip.x-=clipSpeed;
mouseY >= yourClip.y ? yourClip.y+=clipSpeed : yourClip.y-=clipSpeed;


This worked, thank you!