look_at() works, but my polygon uses the wrong side to look at

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

Hi. So, in this 2D game I’m working on I have this rectangle-shaped polygon that has a look_at function set up like this:

func _process(delta):
  var plr_pos = get_node("../../../../Player").pos
  print(plr_pos)
  look_at(plr_pos)

It seems to work, however, it’s supposed to aim at the player, and my rectangle is using the wrong side to do that. How can I fix this?
Thanks in advance.

:bust_in_silhouette: Reply From: usurun

You can either add (90) to the rotation
Or make it negative, that also works

Or start with your object pointing to the right (along the +x axis), which is 0 rotation.

kidscancode | 2019-07-02 21:51

Adding:
rotation_degrees -= 90
to the code above worked. Thanks, guys

Deganic | 2019-07-02 23:11