// Update is called once per frame void Update() { isDead = health.dead; if (isDead) { tag = gameObject.tag; pooler.AddBackToDisctionary(gameObject, tag); index = Random.Range(0, spawn_points.Length); while (tags[index] != tag) { index = Random.Range(0, tags.Length); } pooler.SpawnFrom_Pool(tags[index], spawn_points[index].transform.position, Quaternion.identity); gameObject.SetActive(false); isDead = false; } }