0 votes

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?

in Engine by (17 points)

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

thanks, its sorta helped out

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

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.