mouse position based rotatio?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 09makri

i’m making a top-down dungeon crawler where the player weapon is following the mouse and i wonder if there is a way to make the player sprite do set_flip_h when the mouse over a set point of degrees (like 180 degrees) around the player sprite?

:bust_in_silhouette: Reply From: flurick

Well there is the angle_to() function, but if you just want the character to “look” at the cursor by flipping the x axis it might be easier to just check which side the cursor is on like so:

flip_h = get_local_mouse_position().x < 0