how to use the look_at command script that follows the direction of their movement?

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

i struggled with the ai that facing the same way. i have tried to make the ai to look at the player position but it feels kinda jangky so i want to tried to make the ai to follow their navigation path but it seems that i cant find the tutorial that i was looking for so can anyone give me tips to my problem?

is that the problem?
/////////////////////
this follow
var velo = vector2()

  func _process(_delta):
    var target = $node_target.global_position
    var rot = (target - $Player.position).normalized()
    if $Player.position.distance_to(target) >= 30:
 	  $Player.position += rot * velo
    target.look_at(player.global_position)  //// look at the player ///
pass

ramazan | 2022-02-06 10:19

thanks, its sorta helped out

yedamameday | 2022-02-06 14:51

Ask what is missing. If I don’t know, surely someone will know.

ramazan | 2022-02-06 19:14