Here’s a solid 20 scripts set that works for most Unity games (3D or 2D). The idea is: **get a playable loop fast** (move → interact → UI feedback → save/load), while keeping systems modular. <br><br>`To keep it more manageable, you may even start with 8 scripts (one for each topic), or even one script to manage all (just to get started learning).`
Boot + game state (foundation)
1) GameBootstrapper
One place that initializes core singletons/services, loads the first scene/state, sets target FPS, cursor mode, etc.
2) GameStateManager
Handles high-level states like MainMenu / Loading / Playing / Paused / GameOver (and transitions).
3) SceneLoader
Async scene loads, loading screens, progress reporting, additive loads if needed.
4) TimeManager
Pause, slow-motion, time scale rules, and “don’t pause UI timers” patterns.
Input + controls (so everything can plug in)
5) InputRouter
Wraps Unity Input System (or legacy) and exposes clean events: Move, Look, Jump, Interact, Pause.
6) CursorLockManager
Locks/unlocks cursor on pause/menus, handles edge cases (alt-tab, UI focus).
Player (the “make it playable” core)
7) PlayerController
Movement (CharacterController or Rigidbody), grounded checks, jump, basic locomotion.
8) PlayerMotor (optional split but usually worth it)
Low-level movement application (velocity, acceleration, slopes) so PlayerController stays clean.
9) PlayerHealth
Damage, healing, death event, invulnerability frames, hit reactions (even if simple).
10) PlayerInteractor
Raycast/overlap to detect interactables, shows prompts, triggers interact actions.
Camera (feel matters early)
11) CameraController
Follow/aim, smoothing, rotation, sensitivity, camera modes (first/third person).
12) CameraCollision / CameraObstructionHandler
Prevent camera clipping through walls, pulls camera in or fades obstructing objects.
Interaction + world objects
13) InteractableBase
Common interface/abstract class: GetPromptText(), CanInteract(), Interact().
14) PickupItem
A basic interactable for grabbing items/currency, plays effects, adds to inventory.
15) DoorOrSwitchInteractable
A second interactable type (doors/levers) to prove your interaction system is flexible.
UI (feedback + menus)
16) UIManager
Opens/closes screens (HUD, pause menu, inventory), manages UI stack, blocks input.
17) HUDController
Updates health bar, crosshair, interact prompt, notifications.
18) PauseMenuController
Resume/settings/quit buttons, ties into GameStateManager + CursorLockManager.
Audio + VFX (minimum polish)
19) AudioManager
Play SFX by key, music transitions, volume settings, pooling AudioSources.
Data + persistence (so progress exists)
20) SaveSystem
Save/load player position, health, inventory basics, settings; JSON file or PlayerPrefs (start simple, upgrade later).
20 questions to answer before writing the Foundation script
(GameBootstrapper + GameStateManager + SceneLoader + TimeManager)
- What Unity version are we targeting? (2021 LTS, 2022 LTS, 2023, etc.)
- What build targets matter day one? (PC only, WebGL, mobile, console later)
- Do you want a dedicated Bootstrap scene, or should it work from any scene?
Dedicated Bootstrap scene is simpler and more reliable. - What are the exact scene names and intended flow?
Example:Bootstrap -> MainMenu -> Game -> GameOver -> MainMenu - Are you using additive scenes?
Example: keep a persistent “Core” scene loaded, additively loadLevel_01. - Do you want the bootstrap objects to be
DontDestroyOnLoad, or recreated per scene?
Most games doDontDestroyOnLoadfor the core managers. - How strict should it be about duplicates?
If someone loads Bootstrap twice, do we destroy duplicates, log warnings, or hard fail? - What high-level states do you want on day one?
Pick from: Booting, MainMenu, Loading, Playing, Paused, GameOver, Cutscene, Dialogue, etc. - Do you want a single current state, or a stack of states?
Stack is useful for overlays like Pause on top of Playing. - What transitions are allowed?
Example: Paused can only come from Playing, GameOver can only come from Playing. - Do you want state transitions to be synchronous or async-capable?
Async helps if “entering Playing” includes loading scenes/content. - How should SceneLoader report progress?
- Event callback?
- A float 0–1?
- Separate “fake smoothing” so it looks good?
- Is there a loading screen UI already, or should the foundation script create a basic one?
Also: is it its own scene or an overlay canvas? - Should SceneLoader support “soft reload” of the same scene?
Useful for “Restart Level” behavior. - How should time be paused?
- Use
Time.timeScale = 0 - Or keep timeScale but gate gameplay updates with a paused flag
- Or both
- Use
- What should keep running during pause?
Examples: UI animations, menu navigation, music, network, loading, timers. - Do you want slow motion support on day one?
If yes: can multiple systems request slow-mo at once, and how do we resolve conflicts? - What cursor behavior do you want per state?
Example: locked in Playing, unlocked in MainMenu/Paused, visible or hidden. - How should quitting and returning to menu work?
- Immediate quit
- Confirm quit
- Return to MainMenu and unload gameplay scenes cleanly
- What level of logging/debug tools do you want built in?
Example: verbose logs in editor only, optional on-screen debug state display, dev hotkeys.
Copy/paste prompt to GPT
Paste this exactly, then replace the bracketed answers.
We are starting a Unity game. I want the first Foundation deliverable that covers Boot + game state + scene loading + time control.
Output must be production clean but simple, no third party packages, no dependencies, no addressables required. Prefer coroutines unless my answers clearly require async tasks.
Deliverables
1) C# scripts for:
- GameBootstrapper
- GameStateManager
- SceneLoader
- TimeManager
Also include any small supporting types that are necessary (enums, interfaces, events).
2) Folder path suggestions for where each script should live.
3) Exact Unity Editor setup steps so I can use it immediately (scenes, build settings, game objects, inspector fields).
4) A tiny test checklist I can run in editor to confirm it works.Constraints
- Code must compile on my Unity version.
- Avoid singletons that are hard to test. If you use singletons, do it in a safe simple way.
- Prevent duplicate managers if Bootstrap scene gets loaded twice.
- Provide clear logs in editor only (or behind a bool flag).
- The system must support:
- MainMenu, Loading, Playing, Paused, GameOver at minimum
- Async like scene loading with progress events
- Pause and slow motion
- Cursor lock rules by stateMy answers to the 20 foundation questions
1 Unity version
[PUT ANSWER]2 Build targets
[PUT ANSWER]3 Bootstrap approach (dedicated Bootstrap scene or works from any scene)
[PUT ANSWER]4 Scene names and flow
[PUT ANSWER]5 Additive scene loading (yes or no, and how)
[PUT ANSWER]6 Persistence strategy (DontDestroyOnLoad or recreate)
[PUT ANSWER]7 Duplicate handling (destroy duplicates, warn, hard fail)
[PUT ANSWER]8 Initial states needed (list)
[PUT ANSWER]9 State model (single state or stack)
[PUT ANSWER]10 Allowed transitions
[PUT ANSWER]11 Transition type (sync only or async capable)
[PUT ANSWER]12 Loading progress reporting (events, UI hookup style)
[PUT ANSWER]13 Loading screen (none, simple overlay, separate scene)
[PUT ANSWER]14 Soft reload support (restart same scene)
[PUT ANSWER]15 Pause method (timeScale, paused flag, both)
[PUT ANSWER]16 What continues during pause
[PUT ANSWER]17 Slow motion requirements (yes or no, conflict rules)
[PUT ANSWER]18 Cursor behavior per state (locked, unlocked, visible)
[PUT ANSWER]19 Quit and return to menu behavior
[PUT ANSWER]20 Logging and debug tools desired
[PUT ANSWER]Important output formatting
- Print each script in a separate code block with the filename at the top.
- After code, list setup steps in numbered order.
- Do not ask me follow up questions. Make reasonable defaults if something is unclear, but state your defaults.
How to use the output (once GPT generates it)
Create folders in Assets like:
Assets/Scripts/CoreAssets/Scripts/Core/StateAssets/Scripts/Core/SceneAssets/Scripts/Core/Time
Create the 4 scripts with the exact filenames GPT outputs, paste the code, let Unity compile.
Create scenes (at least):
- Bootstrap
- MainMenu
- Game (or Level01)
- Loading (only if you choose a loading scene)
Add scenes to Build Settings in the correct order, typically Bootstrap first.
In Bootstrap scene:
- Create an empty GameObject called Core
- Add the GameBootstrapper component
- Assign scene names and any settings fields in inspector
Press Play, verify:
- It starts in MainMenu
- Start game triggers Loading then Playing
- Pause changes time and cursor correctly
- Reload or return to menu works cleanly
Email if you need anything - Sean@CompanyLister.com
<div class="footnotes">