Fast answer: Scripts For Unity provides 55 MIT-licensed Unity C# scripts and 13 complete game systems for Unity 2022.3 LTS and newer. Start with the script library if you need one component, or use game systems when several scripts must work together.
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
| Problem | Start Here | Note |
|---|---|---|
2D movement | 2D Player Controller | Use PlayerController2D with CameraFollow2D for platformers. |
3D or FPS movement | 3D Player Controller | Pair PlayerController3D with FirstPersonCamera. |
Health and damage | Health System | Use HealthSystem, then add HealthBarUI and DamagePopup. |
Saving progress | JSON Save Utility | Use JsonSaveUtility for structured save data and PlayerPrefs Save Helper for simple settings. |
Inventory and quests | RPG Essentials | Start with RPG Essentials Kit or combine SimpleInventory, QuestSystem, and DialogueTrigger. |
Mobile controls | Mobile Controls Kit | Use TouchJoystick, TouchButton, SwipeInputController, and MobileSafeArea. |
AI movement | Enemy AI Kit | Use WaypointPatrolAI, EnemyChaseAI, NavMeshClickToMove, and AStarPathfinding. |
Project utilities | Essential Utilities | Every 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.
- 2D platformer: Use 2D Platformer Starter Kit, or combine 2D Player Controller, Smooth Camera Follow 2D, Health System, Pickup / Collectible, and Screen Fader.
- FPS prototype: Use FPS Foundation Kit, or combine 3D Player Controller, First Person Camera, Weapon System, Projectile System, and Camera Shake.
- RPG slice: Use RPG Essentials Kit, or combine Health System, Simple Inventory, Dialogue Trigger, Quest System, and JSON Save Utility.
- Mobile game: Use Mobile Controls Kit, or combine Touch Joystick, Touch Button, Swipe Input Controller, and Mobile Safe Area Handler.
- RTS prototype: Use RTS Starter Kit, or combine Top-Down Camera, NavMesh Click-to-Move, Minimap System, and Wave Spawner.
- Idle game: Use Idle Game System with Idle Income Generator, Timer / Countdown, and PlayerPrefs Save Helper.
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 - centralize one-shot sounds, music, and mixer control.
- 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.
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: These scripts target Unity 2022.3 LTS and newer. If your project is older, check API names before importing.
- 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
- Create a new C# file with the exact class name shown on the script page.
- Paste the source code and let Unity compile before adding it to objects.
- Attach the component to the recommended GameObject type, such as Player, Camera, Manager, or UI Canvas.
- Assign every required Inspector field and read the common mistakes section.
- Test the script in an empty scene before mixing it into a large project.
- Rename variables and tune values only after the baseline behavior works.
Best first stop: Browse the full free Unity C# scripts library, then use complete game systems when you want coordinated bundles like platformer, FPS, RPG, mobile controls, or save/load.