Attention | Topic was automatically imported from the old Question2Answer platform. | |
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-
look_at(get_local_mouse_position())
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