Spawn & Wave System

v1.0.0

Getting Started

Create your first wave spawning system in 5 minutes.

Overview

This guide walks you through creating your first wave spawning system. By the end, you'll have enemies spawning at configured points according to your wave definitions.

5-Minute Setup: Follow these steps to get a working wave system running in minutes. No coding required!

Step 1: Create a Spawn Profile

A SpawnProfile defines what prefab to spawn and how it should be configured.

  1. Right-click in your Project window
  2. Select Create → Spawn Wave System → Spawn Profile
  3. Name it something descriptive like "Enemy_Basic"
  4. Assign your enemy prefab to the Prefab field

SpawnProfile Settings

PrefabThe GameObject to spawn
Display NameName shown in editor and UI
Use PoolingEnable object pooling for performance
Pool SizeInitial pool size (e.g., 20)
Prefab Requirement: Your enemy prefab should have aSpawnedEntityTrackercomponent for SWS to track its lifecycle.

Step 2: Create a Wave Definition

A WaveDefinition specifies what to spawn in a single wave and how.

  1. Right-click in your Project window
  2. Select Create → Spawn Wave System → Wave Definition
  3. Name it "Wave_01"
  4. In the Allocations array, click +
  5. Assign your SpawnProfile and set Count (e.g., 10 enemies)

WaveDefinition Settings

AllocationsList of profiles with spawn counts
Spawn IntervalTime between spawns (seconds)
End ConditionWhen wave is considered complete
Spawn Point SelectionRandom, Round Robin, or Tagged

Step 3: Create a Wave Sequence

A WaveSequence defines the order and mode of your waves.

  1. Right-click in your Project window
  2. Select Create → Spawn Wave System → Wave Sequence
  3. Name it "MainSequence"
  4. In the Waves array, add your Wave Definition(s)
  5. Set the Mode (Single, Loop, or Endless)

Sequence Modes

SinglePlay all waves once, then stop
LoopRepeat the sequence indefinitely
EndlessLoop with optional difficulty scaling

Step 4: Scene Setup

Now set up the runtime components in your scene:

4.1 Add SpawnManager

  1. Create an empty GameObject named "SpawnManager"
  2. Add Component → Spawn Wave System → Spawn Manager

4.2 Add Spawn Points

  1. Create empty GameObjects where you want enemies to spawn
  2. Add Component → Spawn Wave System → Spawn Point
  3. Position them around your scene

4.3 Add WaveController

  1. Create an empty GameObject named "WaveController"
  2. Add Component → Spawn Wave System → Wave Controller
  3. Assign your Wave Sequence to the controller

Scene Hierarchy

Scene
├── SpawnManager
├── WaveController (with WaveSequence assigned)
└── SpawnPoints/
    ├── SpawnPoint_01
    ├── SpawnPoint_02
    └── SpawnPoint_03

Step 5: Start Waves via Visual Scripting

Use GC2 Visual Scripting to trigger the wave sequence:

  1. Create a GameObject with a Trigger component
  2. Add a Trigger condition (e.g., On Button Press, On Start)
  3. Add the Instruction: Spawn Wave System → Waves → Start Wave Sequence
  4. Set the WaveController reference
Done! Press Play and trigger your action. Enemies will spawn at your spawn points according to your wave configuration.

Next Steps

Now that you have basic spawning working, explore these advanced features: