//Jimmy Vegas Unity Tutorial //These scripts are for your NPC using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class NPCAINav : MonoBehaviour { public GameObject theDestination; NavMeshAgent theAgent; void Start() { theAgent = GetComponent(); } void Update() { theAgent.SetDestination(theDestination.transform.position); } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class NPC002Dest : MonoBehaviour { public int pivotPoint; void OnTriggerEnter(Collider other) { if(other.tag == "NPC") { if (pivotPoint == 5) { pivotPoint = 0; } if (pivotPoint == 4) { this.gameObject.transform.position = new Vector3(466, 101, 200); pivotPoint = 5; } if (pivotPoint == 3) { this.gameObject.transform.position = new Vector3(488, 101, 181); pivotPoint = 4; } if (pivotPoint == 2) { this.gameObject.transform.position = new Vector3(493, 101, 197); pivotPoint = 3; } if (pivotPoint == 1) { this.gameObject.transform.position = new Vector3(474, 101, 229); pivotPoint = 2; } if (pivotPoint == 0) { this.gameObject.transform.position = new Vector3(466, 101, 222); pivotPoint = 1; } } } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class SkeletonActivate : MonoBehaviour { void OnTriggerEnter(Collider other) { if(other.tag == "Player") { NavigationAI.canAttack = true; this.gameObject.GetComponent().enabled = false; } } }