Build an RPG
Health, inventory, dialogue, quests, save/load, and damage numbers — the RPG essentials.
Learning Path
Follow these steps in order to build your RPG.
Included Scripts
Health System
Reusable health component with damage, healing, invincibility frames, and events.
- Damage and healing with clamped health values
- Invincibility frames with configurable duration after taking damage
- UnityEvent callbacks for health changed, damaged, healed, and death
Simple Inventory
Lightweight list-based inventory for prototypes. Add, remove, and check items without UI complexity.
- Add, remove, and check items with simple method calls
- Configurable max slots and max stack size per item
- UnityEvents for item added, removed, and inventory changed
Dialogue Trigger
Simple NPC dialogue with sequential messages, typewriter effect, and input to advance. No branching — just clean text sequences.
- Sequential message display with configurable speaker name
- Typewriter text effect with adjustable character speed
- Click or keypress to skip typewriter or advance to next message
Quest System
Lightweight quest tracker with ScriptableObject definitions, objectives, progress tracking, and reward callbacks.
- ScriptableObject quest definitions with name, description, and objectives
- Multiple objective types: Collect, Kill, Talk, Reach, and Custom
- Runtime progress tracking with per-objective counters
JSON Save Utility
File-based JSON save/load utility. Save any serializable class to persistent storage with one method call.
- Save any serializable class to a JSON file with one method call
- Auto-creates the saves directory if it doesn't exist
- Load with type safety using generics
Damage Popup
Floating damage numbers that animate upward and fade out. Supports critical hits, healing, and custom colors.
- Static Create() factory method — no prefab setup required
- Separate colors for normal damage, critical hits, and healing
- Scaled-up text for critical hits with configurable crit scale
Health Bar UI
World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.
- Smooth fill animation with Lerp for satisfying health changes
- Color gradient that shifts from green to yellow to red automatically
- Damage flash effect on the background image when health decreases
Interaction System
Raycast-based interaction with prompt UI, hold-to-interact option, and IInteractable interface. Press E to interact with anything.
- Raycast-based detection from camera or player forward direction
- IInteractable interface for flexible object interaction
- Hold-to-interact mode with progress callback for radial UI
Tooltip System
Dynamic mouse-following tooltip that auto-positions to stay on screen. Supports rich text and custom layouts.
- Singleton pattern with static Show/Hide for easy global access
- Mouse-following position with configurable offset
- Auto-flips tooltip to stay within screen boundaries
Related Systems
RPG Essentials Kit
Core RPG systems: health, inventory, dialogue, quests, save/load, and damage numbers — everything for an RPG prototype.
Complete Inventory System
Drag-and-drop inventory with stackable items, equipment slots, and JSON save/load persistence.
Dialogue System
Node-based dialogue system with branching choices, conditions, events, and typewriter text effect.
Save & Load System
Flexible save system supporting multiple save slots, auto-save, and both JSON and binary serialization.