So some people helped me with the AI, I need the enemy to be able to navigate through a maze, and when in a certain distance from the player, speed will change, Heres the script I have usingUnityEngine; usingSystem.Collections; publicclassAI : MonoBehaviour { publicTransformPlayer; publicfloatmoveSpeed = 2.0f; NavMeshAgentagent; voidStart () { agent = GetComponent<NavMeshAgent> (); } voidUpdate(){ transform.LookAt(Player); transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime); agent.SetDestination (Player.position); } } Anything that has to be added, i can add, just tell me how to get it to patrol!
Patrol is straight forward. Just set a series of way points and have the Navmesh agent navigate to each one in turn. To patrol just loop back to the beginning of the list once all the way points are visited.
I would recommend watching some of the related videos in the Stealth tutorial: http://unity3d.com/learn/tutorials/projects/stealth-tutorial-4x-only Note: This tutorial, overall, doesn't translate to Unity 5, as I understand it, but it should be good reference material for enemy sight scripts and AI. Just watching the vids and reading the scripts under the Enemy Guards section might be useful to what you are looking at.