0 votes

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 setfliph when the mouse over a set point of degrees (like 180 degrees) around the player sprite?

in Engine by (15 points)

1 Answer

0 votes

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
by (911 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.