AI walk around and flashlight stop

Hi, I’m still learning some scripting, but have no idea where to start, and having AI issues. I want to have an AI that walks around the map and and searches for you, FPS controller character though, but to stop him, you have to click on a flashlight over and over to stop him, is there any way or any script that can help me do that? If he gets too close, it’s gonna kill you, basically saying again, AI that walks around and searches, if he finds you, then to stop him you use a spotlight in Unity to make him teleport away. Please help in anyway, this game is my absolute desire to finish, Thank you!

From what i can understand a Nav Mesh will help you achieve the “enemy finding the player” and then you can use scripting to achieve the other half. Have a look at basic nav mesh tutorials and documentation, very easy to use. You can also look at this looooong but detailed tutorial here
https://unity3d.com/learn/tutorials/topics/navigation/nav-meshes
Hope it helps :slight_smile: !! best of luck