Best utility stack: Start with Object Pool, Audio Manager, Scene Manager, Timer / Countdown, Generic Singleton, JSON Save Utility, Screen Fader, and Camera Shake.
Utility scripts are not exciting on their own, but they decide how painful your project becomes after the first prototype. If bullets, sounds, scene loads, timers, and saving are all solved differently in every feature, your game becomes harder to change.
The Utility Layer
Utility Script Picker
| Problem | Use | Note |
|---|---|---|
Repeated spawning | Object Pool | Object Pool is for bullets, VFX, enemies, pickups, and floating text. |
Sound playback | Audio Manager | Audio Manager centralizes music, one-shots, fades, and volume control. |
Level changes | Scene Manager | Scene Manager wraps loading logic so buttons and triggers do not duplicate it. |
Countdowns | Timer / Countdown | Timer / Countdown handles timed rounds, cooldowns, and UI timers. |
Shared managers | Generic Singleton | Generic Singleton is useful for global managers when used sparingly. |
Structured save data | JSON Save Utility | JSON Save Utility stores typed state in readable files. |
Transition polish | Screen Fader | Screen Fader hides hard scene cuts. |
Hit feedback | Camera Shake | Camera Shake makes damage, explosions, and impacts readable. |
Build Path: A Cleaner Prototype Foundation
- Add Audio Manager and keep all UI/gameplay sound calls routed through it.
- Add Object Pool before building weapons, enemies, or damage popups.
- Add Scene Manager and Screen Fader before wiring menus.
- Use Timer / Countdown for cooldowns and timed game modes.
- Use JSON Save Utility once the prototype needs persistent state.
When to Avoid a Utility Script
Do not add a manager just because a manager exists. A singleton is useful for one global audio service; it is a poor fit for per-enemy state. A pool is useful for objects spawned repeatedly; it is unnecessary for a single persistent object. A save utility is useful for structured data; PlayerPrefs is enough for one volume setting.
Common Mistakes
- Pooling without reset: Pooled objects must reset health, velocity, animation, and events before reuse.
- Global everything: Too many singletons make testing and scene setup harder.
- Audio spam: Route frequent sounds through limits or pooling so one event does not create dozens of overlapping clips.
- Scene names as magic strings: Keep scene names centralized if many buttons load scenes.
This is the support layer behind the main free Unity C# scripts catalog. Build it early and your feature scripts stay smaller.