Single Sound — Common Use Cases
Practical examples for standalone effects registered outside any collection.
Overview
SingleSound is the right choice when a clip stands on its own — UI feedback, player actions, level music, and other one-off sounds. Each example below assumes you already have a reference assigned in the Inspector or retrieved with GetSingleSound.
For method signatures and parameter details, see the API Reference.
Player Jump
Jump sounds repeat constantly during gameplay. PlayRandomPitch adds subtle variation on each jump so the effect feels less repetitive without maintaining multiple clips.
Example
Background Music
Level or menu music registered as a single sound can fade in when a scene starts and fade out when the player leaves. Use FadeIn to ramp volume up smoothly and FadeOut to avoid an abrupt cut when transitioning.
Example
Pause and Resume
When the game pauses, hold a looping ambient or music track at its current position with Pause(). Resume playback from the same spot when the player returns — no need to track elapsed time yourself.
Example
Item Pickup
Pickup sounds are short one-shots triggered on collision or interaction. Pass explicit volume and pitch to make rare items feel more rewarding — a slightly higher pitch draws attention without needing a separate clip.
Example