Add audio effects, background music, and particle systems to bring your game to life
PlayOneShot(clip) lets you play a sound without interrupting other sounds on the same AudioSource. Play() stops the current sound first. Always use PlayOneShot for SFX so sounds can overlap!Destroy(other.gameObject):
audioSource.PlayOneShot(jumpSound, 0.7f) (the second parameter is volume 0-1).
SoundManager.Instance. This is the same pattern used in professional games!if (!wasGrounded && isGrounded) SpawnDust();Instantiate(coinSparkle, other.transform.position, Quaternion.identity)
OnVolumeChanged.
sfxSource.pitch = Random.Range(0.9f, 1.1f) before PlayOneShot to make each sound slightly different.