void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player" && isAlive == true) { GameObject g = GameObject.FindGameObjectWithTag("attackBandit"); wander = g.GetComponent<NPCWander>(); wander.attackBandit = true; isAlive = false; } }
void OnTriggerEnter(Collider other) { //test = true; if (other.gameObject.tag == "Player") { GameObject g = GameObject.FindGameObjectWithTag("troll"); wander = g.GetComponent<NPCWander>(); wander.attackTroll = true; } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { if (spawnTroll == true) { troll.SetActive(true); GameObject g = GameObject.FindGameObjectWithTag("troll"); wander = g.GetComponent<NPCWander>(); wander.attackTroll = true; spawnTroll = false; } } }