Creating Momentum in Mouse Direction

In a 2D topdown game I know how to create velocity into directions to make things move in the designated way. How would you create velocity in the direction of the mouse?

Get the screen to world position of the mouse x,y (rendercam make this easy). Calculate the angle (ex: as a radian) between two points first of the object you are moving, and then the mouse x,y screen to world position. Convert this to a vector (direction). Multiply this by some factor when you add to your velocity vector over time. There’s probably a cleaner way to do the above but I only know so much.

I recommend you read the source of the platformer tutorial Platformer Defold tutorial this article on vector math is also useful Linear algebra for game developers ~ part 1 - Wolfire Games Blog