Top Down Shooter error in look_at()

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

I am trying to make a top down shooter where the player faces the mouse cursor.
while searching on net i found look_at() suitable for rotation but when I apply it to my script it doesn’t work as desired.
The code is-


The code is in _physics_process(delta).
Video showing error

have you tried with look_at(get_global_mouse_position()) instead?

p7f | 2020-07-15 15:44

Thanks it worked.

Ras0922$$ | 2020-07-15 18:30

no problem! you may select your own answer so others can see its solved.

p7f | 2020-07-15 18:58

:bust_in_silhouette: Reply From: Ras0922$$

As p7f said in comment it works withlook_at(get_global_mouse_location()).
Once again thanks p7f