Free Unity C# Scripts and Game Systems: 55 Copy-Paste Tools for Indie Games

A catalog of 55 free Unity C# scripts and 13 game systems: movement, camera, health, save/load, UI, AI, mobile controls, inventory and dialogue.

This page is a practical index, not a theory article. If you are building an indie game and need working Unity C# code today, use it to pick the right script by problem: movement, camera, health, save/load, UI, AI, mobile input, inventory, dialogue, audio, and utility infrastructure.

The strongest use case is prototyping. You can copy one script into an existing project, or combine a small set of scripts into a playable slice. Each script page includes source code, Inspector notes, usage steps, and common mistakes, so you can adapt the code instead of treating it as a black box.

Choose by Game Problem

Unity Script Picker

ProblemStart HereNote
2D movement2D Player ControllerUse PlayerController2D with CameraFollow2D for platformers.
3D or FPS movement3D Player ControllerPair PlayerController3D with FirstPersonCamera.
Health and damageHealth SystemUse HealthSystem, then add HealthBarUI and DamagePopup.
Saving progressJSON Save UtilityUse JsonSaveUtility for structured save data and PlayerPrefs Save Helper for simple settings.
Inventory and questsRPG EssentialsStart with RPG Essentials Kit or combine SimpleInventory, QuestSystem, and DialogueTrigger.
Mobile controlsMobile Controls KitUse TouchJoystick, TouchButton, SwipeInputController, and MobileSafeArea.
AI movementEnemy AI KitUse WaypointPatrolAI, EnemyChaseAI, NavMeshClickToMove, and AStarPathfinding.
Project utilitiesEssential UtilitiesEvery prototype benefits from ObjectPool, AudioManager, SceneManager, and TimerCountdown.

Start a Game in 30 Minutes

The fastest path is to pick a small game target and wire only the scripts needed for that slice. Do not begin by importing every script. Start with the smallest set that proves movement, feedback, saving, and one loop.

Essential Scripts Every Unity Project Needs

Some scripts are useful regardless of genre. These are the pieces that reduce repeated glue code and make prototypes less fragile.

  • Object Pool - reuse bullets, enemies, damage numbers, and effects instead of instantiating every time.
  • Audio Manager - centralise one-shot sounds, music crossfades and volume.
  • Scene Manager - wrap scene transitions so buttons and triggers call one stable API.
  • Health System - give players, enemies, breakables, and bosses a consistent damage contract.
  • JSON Save Utility - save structured game state without building a save framework from scratch.

The utility layer

Utility scripts decide how painful a project becomes after the first prototype. If bullets, sounds, scene loads, timers and saving are solved differently in every feature, the game gets harder to change. Add this layer early and your feature scripts stay small.

Utility script picker

ProblemUseNote
Repeated spawningObject PoolObject Pool for bullets, effects, enemies, pickups and floating text.
Sound playbackAudio ManagerAudio Manager centralises music, one-shots, fades and volume.
Level changesScene ManagerScene Manager wraps loading so buttons and triggers share one API.
Countdowns and cooldownsTimer / CountdownTimer / Countdown for timed rounds, cooldowns and UI timers.
Shared managersGeneric SingletonGeneric Singleton for a few global services, used sparingly.
Structured save dataJSON Save UtilityJSON Save Utility stores typed state in readable files.
TransitionsScreen FaderScreen Fader hides hard scene cuts.
Hit feedbackCamera ShakeCamera Shake makes impacts readable.

When to skip a utility

Do not add a manager because one exists. A singleton suits one global audio service, not per-enemy state. A pool suits objects spawned again and again, not a single persistent object. PlayerPrefs is enough for one volume setting; a JSON save suits structured game state.

  • Pooling without reset: pooled objects must reset health, velocity, animation state and event subscriptions before reuse.
  • Global everything: too many singletons make scenes hard to test and set up.
  • Audio spam: limit how often a frequent sound can play so one event does not stack dozens of clips.
  • Scene names as magic strings: keep scene names in one place if many buttons load scenes.

When Not to Copy a Script Blindly

Copy-paste scripts save time, but they are not magic. Treat every script as a starting point that needs a quick fit check against your project. The goal is speed with control, not mystery code.

  • Unity version: Most of these scripts target Unity 2022.3 LTS and newer; a few use Unity 6 physics APIs and need Unity 6. Each script page states its version.
  • Input system assumptions: Some scripts use the built-in Input API. If your project uses the newer Input System package, adapt the input wrapper rather than editing gameplay logic everywhere.
  • Inspector setup: Many scripts use [SerializeField]. Missing references are the most common setup bug, so read the usage steps before pressing Play.
  • Serialization limits: PlayerPrefs is fine for small preferences. Use JSON or a proper save system for game state, inventory, quest progress, or multiple save slots.
  • Dependencies: Individual scripts are designed to stand alone where possible. Complete game systems intentionally include multiple scripts that expect each other.

How to Use These Scripts Safely

  1. Create a new C# file with the exact class name shown on the script page.
  2. Paste the source code and let Unity compile before adding it to objects.
  3. Attach the component to the recommended GameObject type, such as Player, Camera, Manager, or UI Canvas.
  4. Assign every required Inspector field and read the common mistakes section.
  5. Test the script in an empty scene before mixing it into a large project.
  6. Rename variables and tune values only after the baseline behavior works.

Scripts and kits in this article

Related articles

Sources

Written by Mete, the Unity developer who makes Scripts For Unity and shares it free with the community. Articles cite the Unity documentation they rely on, state the Unity version they were written for, and show an updated date only when the text or code changed. How articles are written and checked