void OnTriggerEnter2D(Collider2D other) { if (other.name == "Player") { powerupManager.ActivatePowerUp(doublePoints, safeMode, powerupLength); } gameObject.SetActive(false); }
void OnTriggerEnter2D(Collider2D other) // on collision getting the game object to detect the player TAg then add points depending on ScoreGive " IMPORTANT TO WRITE EACH word CORRECTly or Unity wont understand "OnTriggerEnter2D" { if (other.gameObject.tag == "Player") { ShieldOn = true; sound = PlayClipAt(Audio); sound.volume = 0.2f; sound.panStereo = 0; //Debug.Log("dont bash"); PwUpManager.ActivatePowerUp(ShieldOn, powerupDuration); gameObject.SetActive(false); } }