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.
public class HealthSystem : MonoBehaviour
{
[SerializeField] private float maxHealth = 100f;
public float HealthPercent => currentHealth / maxHealth;
public void TakeDamage(float damage)
public void Heal(float amount)Simple Inventory
Lightweight list-based inventory for prototypes. Add, remove, and check items without UI complexity.
public class SimpleInventory : MonoBehaviour
{
[SerializeField] private int maxSlots = 20;
public int AddItem(string itemId, int quantity = 1)
public int RemoveItem(string itemId, int quantity = 1)Dialogue Trigger
Simple NPC dialogue with sequential messages, typewriter effect, and input to advance. No branchi...
public class DialogueTrigger : MonoBehaviour
{
[SerializeField] private string speakerName = "NPC";
[SerializeField] [TextArea(2, 5)] private string[] messages;
public void StartDialogue()Quest System
Lightweight quest tracker with ScriptableObject definitions, objectives, progress tracking, and r...
public class QuestSystem : MonoBehaviour
{
public static QuestSystem Instance { get; private set; }
public bool AcceptQuest(QuestData quest)
public void ReportProgress(string objectiveId, int amount = 1)JSON Save Utility
File-based JSON save/load utility. Save any serializable class to persistent storage with one met...
public static class JsonSaveUtility
{
public static void Save<T>(T data, string fileName)
public static T Load<T>(string fileName)
public static bool Exists(string fileName)Damage Popup
Floating damage numbers that animate upward and fade out. Supports critical hits, healing, and cu...
public class DamagePopup : MonoBehaviour
{
public static DamagePopup Create(
Vector3 position, float amount,
bool isCritical = false, bool isHeal = false)Health Bar UI
World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach...
public class HealthBarUI : MonoBehaviour
{
[SerializeField] private float smoothSpeed = 5f;
[SerializeField] private Gradient colorGradient;
public void SetHealth(float current, float max)Interaction System
Raycast-based interaction with prompt UI, hold-to-interact option, and IInteractable interface. P...
public interface IInteractable
{
string InteractionPrompt { get; }
void Interact(GameObject interactor);
}Tooltip System
Dynamic mouse-following tooltip that auto-positions to stay on screen. Supports rich text and cus...
public class TooltipSystem : MonoBehaviour
{
public static TooltipSystem Instance { get; private set; }
public static void Show(string header, string body = "")
public static void Hide()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.