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.
- Right-click in your Project window
- Select
Create → Spawn Wave System → Spawn Profile - Name it something descriptive like "Enemy_Basic"
- Assign your enemy prefab to the Prefab field
SpawnProfile Settings
| Prefab | The GameObject to spawn |
| Display Name | Name shown in editor and UI |
| Use Pooling | Enable object pooling for performance |
| Pool Size | Initial pool size (e.g., 20) |
Prefab Requirement: Your enemy prefab should have a
SpawnedEntityTrackercomponent for SWS to track its lifecycle.Step 2: Create a Wave Definition
A WaveDefinition specifies what to spawn in a single wave and how.
- Right-click in your Project window
- Select
Create → Spawn Wave System → Wave Definition - Name it "Wave_01"
- In the Allocations array, click +
- Assign your SpawnProfile and set Count (e.g., 10 enemies)
WaveDefinition Settings
| Allocations | List of profiles with spawn counts |
| Spawn Interval | Time between spawns (seconds) |
| End Condition | When wave is considered complete |
| Spawn Point Selection | Random, Round Robin, or Tagged |
Step 3: Create a Wave Sequence
A WaveSequence defines the order and mode of your waves.
- Right-click in your Project window
- Select
Create → Spawn Wave System → Wave Sequence - Name it "MainSequence"
- In the Waves array, add your Wave Definition(s)
- Set the Mode (Single, Loop, or Endless)
Sequence Modes
| Single | Play all waves once, then stop |
| Loop | Repeat the sequence indefinitely |
| Endless | Loop with optional difficulty scaling |
Step 4: Scene Setup
Now set up the runtime components in your scene:
4.1 Add SpawnManager
- Create an empty GameObject named "SpawnManager"
- Add Component → Spawn Wave System → Spawn Manager
4.2 Add Spawn Points
- Create empty GameObjects where you want enemies to spawn
- Add Component → Spawn Wave System → Spawn Point
- Position them around your scene
4.3 Add WaveController
- Create an empty GameObject named "WaveController"
- Add Component → Spawn Wave System → Wave Controller
- Assign your Wave Sequence to the controller
Scene Hierarchy
Scene
├── SpawnManager
├── WaveController (with WaveSequence assigned)
└── SpawnPoints/
├── SpawnPoint_01
├── SpawnPoint_02
└── SpawnPoint_03Step 5: Start Waves via Visual Scripting
Use GC2 Visual Scripting to trigger the wave sequence:
- Create a GameObject with a Trigger component
- Add a Trigger condition (e.g., On Button Press, On Start)
- Add the Instruction:
Spawn Wave System → Waves → Start Wave Sequence - 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: