Hi, i am making a game in which you use a gun that looks at the mouse. it follows the mouse nicely, but i need to get the exact rotation of the gun to calculate the knock back and the value exceeds 360 and goes on as i rotate it.
here's the code:
look_at(get_global_mouse_position())
if get_global_mouse_position().x > global_position.x:
sprite.flip_v = false
if get_global_mouse_position().x < global_position.x:
sprite.flip_v = true