private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Water")) { timer = 2; countDown = true; if (!waterParticleL && !waterParticleR) { waterParticleL = Instantiate(waterPrefab, waterPosL.transform); waterParticleR = Instantiate(waterPrefab, waterPosR.transform); if (aud.isPlaying) { } else { var rnd = Random.Range(0, 2); if (rnd == 0) { aud.clip = water1; aud.Play(); } else { aud.clip = water2; aud.Play(); } } } } if (other.gameObject.CompareTag("addflock")) { flock.AddToFlock(); } }