public void Kill() { gameObject.SetActive(false); if (gameObject.name == "Player") { gameObject.GetComponent <Player>().OnDeath(); } var explosion = ExplosionController.GetAvailble(); explosion.gameObject.SetActive(true); explosion.gameObject.transform.position = transform.position; }