system
1
|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
X |
I have a simple arcade game and i would like the foe to look at the player. I used the “look_at” method and it works.
However, the part of the enemy that is looking at the player is his right side one and not his front or up one.
How can i fix that?
system
2
|
|
|
 |
Reply From: |
kidscancode |
In Godot (as in geometry), an angle of 0 degrees points along the x axis. look_at()
will point your object’s local x axis at the target.
The “solution” is to align your sprite so that it’s pointing to the right when the rotation is 0.
1 Like
system
3
|
|
|
 |
Reply From: |
exuin |
Since 0 radians points to the right, subtract PI/2 radians from the angle you’re looking at.
Excuse my ignorance, but how can i do that?