I need help
I want the enemy to follow the player at a specific distance 2d game top down
If you use the AIPath/RichAI movement scripts you can set the ‘end reached distance’ to your distance and then set the ‘whenCloseToDestination’ mode to ‘Stop’. This will make the AI stop when it comes within a certain distance of the player.
Thanks for the reply
But I want the opposite
I want the enemy to attack the player when reaching a certain distance
Is not there to help
I am a novice in this field
If you have some attack code you can check when you should start to use it using the ai.remainingDistance property.
You can use something like:
new Vector3(player.position.x, transform.position.y,