How do I get a direction from the relation between the player character and the mouse position, without the character looking at the mouse? The goal is when I click the screen a projectile goes towards the mouse position.
Mouse position can be retrieved using get_global_mouse_position().
To get the direction to the mouse, you can do something like:
var direction := global_position.direction_to(get_global_mouse_position())
That will just get a direction vector but not affect anything else (your player will not look at it as there’s no code doing that).
Note that I’m using global_position which will use the position of the node the script is on, but you can use a Vector2 of any source.
Then, applied that direction variable to anything you want. In your case, that would be your projectile.