//Jimmy Vegas Unity Tutorial //This script is for a fleeing NPC using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class NPCAlerted : MonoBehaviour { void OnTriggerEnter(Collider npc) { if (npc.tag == "NPC") { npc.GetComponent().Play("Running"); npc.GetComponent().speed = 7.5f; } } }