- Edited
For 2D, you can just use something like this to look at the mouse (untested):
func look_at_mouse():
var mouse_pos = get_global_mouse_position()
var mouse_direction = global_position.direction_to(mouse_pos)
var mouse_angle = atan2(mouse_direction.y, mouse_direction.x)
# you can also use the following instead of the line above
# var mouse_angle = mouse_direction.angle()
# its the same code internally either way
rotation = mouse_angle