intermediate

Build an RTS Game

Top-down camera, click-to-move navigation, unit selection, minimap, and wave spawning for real-time strategy.

7 scripts · 2 systems

Learning Path

Follow these steps in order to build your RTS Game.

Included Scripts

Movement Beginner

Top-Down Camera

RTS/strategy camera with WASD panning, edge scrolling, scroll wheel zoom, and optional target fol...

3D RTSRPG
public class TopDownCamera : MonoBehaviour
{
    [SerializeField] private float panSpeed = 20f;
    [SerializeField] private bool enableEdgeScroll = true;
    [SerializeField] private float zoomSpeed = 5f;
2022.3+ · 2.6 KB
AI & Pathfinding Intermediate

NavMesh Click-to-Move

Click-to-move character controller using NavMeshAgent. Click anywhere to navigate, with destinati...

3D RTSRPG
[RequireComponent(typeof(NavMeshAgent))]
public class NavMeshClickToMove : MonoBehaviour
{
    private NavMeshAgent agent;
    public void MoveTo(Vector3 destination)
2022.3+ · 2.1 KB
UI Intermediate

Minimap System

Render texture minimap with player icon, enemy blips, objective markers, and zoom control.

RTSRPG
public class MinimapSystem : MonoBehaviour
{
    public static MinimapSystem Instance { get; private set; }
    public static void RegisterIcon(Transform target, Color color, float scale = 1f)
    public void ZoomIn()
    public void ZoomOut()
2022.3+ · 3.2 KB
Utilities Intermediate

Wave Spawner

Wave-based enemy spawner with configurable wave definitions, spawn points, delays, and wave compl...

FPSRTS
public class WaveSpawner : MonoBehaviour
{
    [System.Serializable]
    public class Wave
    {
        public string waveName = "Wave";
        public EnemySpawn[] enemies;
    }
    private IEnumerator SpawnWave()
2022.3+ · 3.0 KB
Health & Combat Beginner

Health System

Reusable health component with damage, healing, invincibility frames, and events.

PlatformerFPS
public class HealthSystem : MonoBehaviour
{
    [SerializeField] private float maxHealth = 100f;
    public float HealthPercent => currentHealth / maxHealth;
    public void TakeDamage(float damage)
    public void Heal(float amount)
2022.3+ · 2.4 KB
AI & Pathfinding Beginner

Waypoint Patrol AI

Enemy patrol between waypoints with configurable speed, wait times, and patrol patterns (loop, pi...

RPGRTS
public class WaypointPatrol : MonoBehaviour
{
    public enum PatrolMode { Loop, PingPong, Random }
    [SerializeField] private Transform[] waypoints;
    [SerializeField] private float moveSpeed = 3f;
    [SerializeField] private PatrolMode patrolMode = PatrolMode.Loop;
2022.3+ · 2.3 KB
UI Beginner

Health Bar UI

World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach...

RPGFPS
public class HealthBarUI : MonoBehaviour
{
    [SerializeField] private float smoothSpeed = 5f;
    [SerializeField] private Gradient colorGradient;
    public void SetHealth(float current, float max)
2022.3+ · 2.4 KB

Related Systems

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

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