void OnTriggerEnter(Collider other) { GameObject go = other.gameObject; if (go.CompareTag("Player")) { if (kart.GetComponent <OvershieldPUP>()) { Debug.Log("Already have an OS, destroying this one"); Destroy(kart.GetComponent <OvershieldPUP>()); } // create the new PowerUp PowerUp po = kart.gameObject.AddComponent <OvershieldPUP>(); // if it is the only PowerUp then it should be active PowerUp[] pups = kart.gameObject.GetComponents <PowerUp>(); po.Init(); po.powerUpGO = powerUpGO; po.kart = kart; po.uses = uses; po.passiveLifetime = passiveLifetime; Debug.Log("Destroying!"); Destroy(gameObject); } }