Hey, so I created an instance variable "Acceleration" for my sprite. I've made it so that every tick the sprite looks at the mouse and every tick the sprite moves forward negative sprite.Acceleration pixels. (Initial value for Acceleration is 0)
I've also set the Acceleration to clamp(sprite.Acceleration,0,5) every tick.
When left mouse button is down 1 is added to "Acceleration" else 0.1 is subtracted from "Acceleration".
When I preview, if I press LMB it moves away from the mouse and slows down to 0 the way I want. But when I'm not pressing LMB it keeps moving towards the mouse.
I made a text object to display "Acceleration", in which it shows it to be 0 when LMB is not pressed.