Godot Version
Godot 4.3
Question
I am trying to apply recoil in my top down 2d game. To apply recoil in the opposite direction, I am just setting my velocity to the negative of the cursor position.
var target_pos = get_global_mouse_position() - position
velocity = -target_pos
move_and_slide()
#Inside fire function
But this creates a problem because depending on how far my cursor is from the player, the recoil will vary. Please help!