//Jimmy Vegas Unity Tutorial //These scripts are for your skeleton using System.Collections; using System.Collections.Generic; using UnityEngine; public class SkeletonWander : MonoBehaviour { public int xPos; public int zPos; void OnTriggerEnter(Collider other) { if(other.tag == "Enemy") { this.gameObject.GetComponent().enabled = false; xPos = Random.Range(475, 489); zPos = Random.Range(124, 145); this.gameObject.transform.position = new Vector3(xPos, 102, zPos); this.gameObject.GetComponent().enabled = true; } } } 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; } } }