How to spawn a projectile based on mouse location

Godot Version



I want to shoot a projectile based on the location of the mouse (in degrees) without rotating the players sprite, how would i do this.

Find the vector of the mouse’s local position (its position relative to the character).
Then, normalize the vector. (This is so that the actual distance of the mouse from the character doesn’t matter, only the direction)
Finally, multiply the vector by what you want the velocity to be, and set that as the velocity of the projectile.