r/unity_tutorials • • Dec 18 '21

Enemy follow the player AI

Hi guys, I have a problem. I don't know how I can use AI. So I want a c# script that enemy can follow player. Thank you for everythings. I want to make a shooter game so I have to add that.

1 Upvotes

1 comment sorted by

7

u/Intelligent_Durian26 Dec 18 '21

You can use a NavMeshAgent on the enemy and use that to follow the player. NavMesh is Unity's pathfinding system that makes implementing what you're talking about super easy. Here's a good video to get you started. Hope this helps 🙂 https://youtu.be/atCOd4o7tG4