view direction update when mouse cursor are to near to player and has movement
puppetmaster- opened this issue · comments
this script should have some update (tolerance factor) when it should change the view direction:
https://github.com/puppetmaster-/darkhours/blob/master/scenes/player.gd
if old_mouse_pos != get_node("/root/game/Camera2D").get_global_mouse_pos():
set_rot( get_global_pos().angle_to_point(get_node("/root/game/Camera2D").get_global_mouse_pos()) + deg2rad(90))
posible solution:
calculate diff between old_mouse_pos and new_mouse_pos
if more than x then update player rotation
fixed