Assets / Scripts For Unity

Free Unity C# scripts that actually compile.

55 scripts, 13 complete systems, and 34 guide chapters. MIT licensed, no signup.

Scripts For Unity | Free C# Scripts & Game Systems for Unity

Scripts For Unity |
55 scripts· 13 systems· 27 articles
Build Succeeded

New scripts

All 55 scripts →

Movement Beginner

2D Player Controller

Complete 2D character controller with smooth movement, variable-height jumping, and coyote time.

  • Variable-height jumping with configurable force
  • Coyote time for forgiving edge jumps
  • Jump buffering for responsive input queuing

PlayerController2D.cs 3.2 KB Unity 2022.3+

Movement Intermediate

3D Player Controller

First/third person character controller with smooth movement, jumping, and slope handling using CharacterController.

  • Camera-relative movement so the player moves where the camera faces
  • Sprint toggle with Left Shift and separate walk/sprint speeds
  • Smooth rotation via LerpAngle for natural turning

PlayerController3D.cs 4.1 KB Unity 2022.3+

Movement Beginner

Smooth Camera Follow 2D

Smooth camera follow with offset, dead zone, and look-ahead for 2D games.

  • Smooth Lerp-based camera following with adjustable speed
  • Configurable offset for custom framing
  • Look-ahead in movement direction for better visibility

CameraFollow2D.cs 1.8 KB Unity 2022.3+

Utilities Intermediate

Generic Singleton

Thread-safe, persistent singleton base class for managers like AudioManager, GameManager, etc.

  • Generic base class — inherit to make any MonoBehaviour a singleton
  • Thread-safe access with lock object for multi-threaded scenarios
  • Auto-creates instance if none exists in the scene

Singleton.cs 1.2 KB Unity 2022.3+

From the blog

All 27 articles →

Guides

13

Complete Inventory System

intermediate 5 files

Drag-and-drop inventory with stackable items, equipment slots, and JSON save/load persistence.

RPGGeneral
Drag & drop items between slots Stackable items with max stack size Equipment slots (head, chest, weapon, etc.) ScriptableObject item definitions

Dialogue System

intermediate 5 files

Node-based dialogue system with branching choices, conditions, events, and typewriter text effect.

RPGGeneral
Branching dialogue with player choices Condition-based branches (quest state, items, etc.) Typewriter text animation Speaker portraits and names

Save & Load System

intermediate 4 files

Flexible save system supporting multiple save slots, auto-save, and both JSON and binary serialization.

RPGGeneral
Multiple save slots Auto-save with configurable interval JSON and binary serialization options ISaveable interface for custom save data

Finite State Machine

advanced 4 files

Clean, extensible state machine for AI, player states, and game flow. Uses ScriptableObject states.

RPGFPSGeneral
ScriptableObject-based state definitions Clean enter/execute/exit lifecycle Conditional transitions with priorities Debug visualization in editor

2D Platformer Starter Kit

beginner 6 files

Complete 2D platformer foundation with movement, camera, advanced mechanics, health, collectibles, and transitions.

Platformer
Complete character controller with coyote time and jump buffering Wall jump, wall slide, dash, and double jump mechanics Smooth camera follow with look-ahead and dead zone Health system with invincibility frames and events

FPS Foundation Kit

intermediate 6 files

First-person shooter foundation with movement, camera, weapons, projectiles, health, and screen shake.

FPSHorror
3D character controller with sprint, jump, and slope handling First person mouse look with sensitivity and vertical clamp ScriptableObject weapon system (melee and ranged) Pooled projectiles with damage, homing, and impact VFX

RTS Starter Kit

intermediate 6 files

Real-time strategy foundation with camera, click-to-move navigation, unit selection, minimap, and wave spawning.

RTS
Top-down camera with WASD pan, edge scroll, and zoom Click-to-move navigation using NavMesh agents Box selection and click selection for units Render texture minimap with unit blips and zoom

RPG Essentials Kit

intermediate 6 files

Core RPG systems: health, inventory, dialogue, quests, save/load, and damage numbers — everything for an RPG prototype.

RPG
Health system with damage, healing, and death events Simple inventory with stacking and capacity limits NPC dialogue with typewriter effect and sequential messages Quest tracker with ScriptableObject definitions and objectives

Enemy AI Kit

intermediate 6 files

Complete enemy AI pipeline: state machine, patrol, chase, health, and wave spawning with debug visualization.

RPGFPSGeneral
Finite state machine with clean enter/execute/exit lifecycle Waypoint patrol with loop, ping-pong, and random patterns Player detection with radius, FOV, and line-of-sight checks Chase behavior with give-up distance and return-to-origin

UI Toolkit Kit

intermediate 6 files

Essential game UI components: health bars, damage numbers, tooltips, minimap, screen fader, and timer display.

RPGFPSGeneral
Health bar with smooth fill, color gradient, and damage flash Floating damage and healing numbers with animations Mouse-following tooltip with auto-positioning and rich text Screen fade-in/fade-out for transitions and cutscenes

Hyper-Casual Starter Kit

beginner 5 files

Everything you need to prototype hyper-casual games in hours — one-tap input, endless runner template, stack mechanic, score tracking, and swipe controls.

Hyper CasualMobile
One-tap gameplay mechanics Endless runner template with lane switching Stack/tower builder mechanic Score tracking with combos and high score

Mobile Controls Kit

intermediate 6 files

Complete touch input system for any mobile Unity game — virtual joystick, on-screen buttons, swipe gestures, pinch-to-zoom, gyroscope, and safe area handling.

Mobile
Virtual joystick with dynamic positioning Configurable on-screen action buttons 4-directional swipe gesture detection Pinch-to-zoom for orthographic and perspective cameras

Idle Game System

intermediate 3 files

Core systems for idle/incremental games — passive income generation, offline earnings, upgrade progression, number formatting, and responsive mobile UI.

Mobile
Passive income generation per second Offline earnings calculation on app resume Exponential cost upgrade system Number formatting (K, M, B, T)