Godot Version
4
Question
im making a enemy ai and i want the enemy to stop when its a certain distance away from the player, how would i be able to do this?
4
im making a enemy ai and i want the enemy to stop when its a certain distance away from the player, how would i be able to do this?
Use the function distance to:
var distance = player.global_position.distance_to(enemy.global_position)
print(distance)
Ok i will try it, ty
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.