Audio, Music & Game Feel
The presentation layer — music, combat SFX, and the "juice" (hitstop, screen shake, hit feedback) that makes combat read as impactful. All client-side, guarded out of the server build.
Music
MusicController— singleton scene music player (RequireComponent(AudioSource)). Handles a starting track, loop, fade-in/out, ambient playlists, and saved volume/mute prefs (music_volume,music_muted). API:Instance.SetVolume/SetMuted/SetTrack/SetPlaylist.MusicZoneTrigger— a trigger volume that starts an ambient playlist (or stops music) when the local player enters a zone, with a fade. Builds its playlist from a primaryzoneTrackplus optionaladditionalTracks; plays each track once, then waits a randomized silence interval (minSilenceSeconds–maxSilenceSeconds, defaults 30–120 s) before picking the next track. Local-player-only by default; can be one-shot or repeatable.
Combat SFX
CombatAudio— singleton 2D combat SFX manager (melee hit, ranged hit, death, shield, wave alert, ability cast). Clips assigned in the Inspector.
Game feel / juice
Tunable centrally by an optional FeelConfig ScriptableObject (loaded from Resources/FeelConfig); each system falls back to its own Inspector defaults if the asset is absent.
| System | What it does |
|---|---|
HitstopManager | Client-side time-freeze on melee connect (Light 30ms → KillBlow). Uses unscaled time so it never disturbs the server tick. Doesn't stack — a heavier freeze extends, a lighter one is ignored. |
ScreenShake | Trauma-based camera shake (magnitude = trauma², trauma decays linearly). AddTrauma(0.3) light hit → 1.0 boss slam. Small hits don't compound into a huge shake. |
PlayerHitFeedback | Local-player receive-hit feedback (isLocalPlayer guarded). Hooks Health.onDamageTaken after the server applies damage — plays hurt/shield SFX, damage number, and screen shake proportional to the damage fraction. |
FloatingDamageText | Damage numbers (white direct / yellow crit / orange condition / green heal / blue absorb; <5 suppressed). See UI & HUD Systems. |
EnemyDeathVFX, SpawnEffect | Death and spawn visual flourishes. |
Every system here is client-only. HitstopManager, ScreenShake, CombatAudio are guarded with #if UNITY_EDITOR || !UNITY_SERVER; hitstop deliberately uses unscaled time so freezing the client view can't slow the authoritative server. See Mirror Networking & Discipline.
This page owns the timing juice (hitstop, shake, hit feedback, damage numbers). Spell/ability VFX, ground-decal indicators, and environmental/login effects are documented in Visual Effects & VFX Pipeline.
Related: Visual Effects & VFX Pipeline · Combat Core & Loop · UI & HUD Systems · Mirror Networking & Discipline