Wave Trigger
Runtime Spawner includes a complete wave spawning system suitable for tower defense–style gameplay, horde modes, ambushes, and scripted “hold & defend” encounters (e.g., Left 4 Dead–style events).
A WaveTrigger defines when a wave sequence begins. The activation volume is defined by a BoxCollider set as a trigger.
Creating a Wave Trigger
To create a new Wave Trigger:
Open the Runtime Spawner inspector.
Click the “+” button in the Wave Triggers section.
This will:
Create a child GameObject
Add a
WaveTriggerAdd and configure a
BoxCollider(set toisTrigger = true)
Note WaveTriggers and WaveSpawnPoints do not need to be children of RuntimeSpawner (since 1.3.0). They can live in additively loaded scenes, prefabs, or procedural tiles added at runtime.
Fundamentals
WaveTrigger is an activation component, not a spawner.
It does not spawn enemies directly. Instead, it:
Detects when a wave should begin
Routes activation through the RuntimeSpawner
Manages trigger state, reactivation, and events
Provides designer-friendly UnityEvents and system-level C# events
Use a WaveTrigger to drive:
Scripted wave encounters (hordes, ambushes, defenses)
One-shot or repeatable combat arenas
Waves that start on player approach
Waves that start automatically at level start
Networked encounters driven deterministically by authority
Requirements
A BoxCollider on the same GameObject
BoxCollider.isTrigger = trueA RuntimeSpawner must exist in the scene
A WaveSpawner asset must be assigned
The collider is auto-assigned to
TriggerZoneinOnEnable()
For trigger events to fire in UnityPhysics mode:
At least one collider must have a Rigidbody (usually the player)
Responsibilities
WaveTrigger is responsible for:
Detecting activation conditions (UnityPhysics or External)
Starting and stopping wave sequences via RuntimeSpawner
Tracking whether the trigger is currently activated
Optionally rearming itself after a cooldown
Exposing UnityEvents and static events for gameplay systems
Providing optional spawn anchors (WaveSpawnPoints)
Key Properties
Trigger & State
BoxCollider TriggerZone
The collider used as the activation volume.
Auto-assigned and configured in OnEnable().
bool IsActivated (read-only externally)
Indicates whether the wave trigger is currently active.
truewhile a wave sequence is runningSet internally by the trigger lifecycle
Cannot be set directly by external systems
bool IsInside
Whether the trigger volume is currently occupied (inside state).
Used for trigger events and external driver replication.
int ActiveWave
Current wave index (0-based).
Managed by the wave runner / RuntimeSpawner.
Wave Configuration
WaveSpawner WaveSpawner
The wave table used when this trigger activates.
Must be assigned for the trigger to function.
List<WaveSpawnPoint> WaveSpawnPoints
Optional anchor points used during wave spawning.
When present:
Spawn locations are chosen from these anchors
Selection is handled by the wave system
Activation & Reactivation (Inspector)
bool startAutomatically
When enabled, the trigger activates automatically once:
RuntimeSpawner is initialized, and
WaveTrigger has started
Useful for:
Survival mode openers
Scripted intro fights
bool reactivateTrigger
If enabled, the trigger will reset after a cooldown and can activate again.
float reactivateTime
Cooldown time (seconds) before the trigger becomes eligible again.
Trigger Driver Mode (New in 1.6.0)
ActivationMode
UnityPhysics – Uses
OnTriggerEnter/ExitExternal – Trigger is driven by an external system (Fusion / PUN)
This allows WaveTrigger to be used safely in networked games.
Public API (Designers & Drivers)
WaveTrigger is now API-driven. External systems must not mutate internal state directly.
Starting a Wave
This is the canonical activation path.
It routes through RuntimeSpawner.ActivateWaveTrigger(this) and updates state/events consistently.
Stopping a Wave
External Activation (Networking)
Use this from authoritative networking drivers.
External Reset (Deterministic)
Cancels any local reset coroutine and returns the trigger to an eligible state.
External Occupancy (Replication)
Used by Fusion / PUN drivers to replicate trigger presence deterministically.
Events
Static C# Events (Systems)
Use these for:
Global encounter tracking
Director systems
UI/audio managers without scene references
UnityEvents – Trigger Occupancy
OnTriggerEnterEventOnTriggerStayEventOnTriggerExitEventOnTriggerStateChanged(bool inside)
These emulate trigger-style behavior and are useful for:
FX
Sensors
Debug visualizations
UnityEvents – Wave Lifecycle
OnWaveActivatedOnWaveCompletedOnWaveDeactivatedOnWaveReset
Use these for:
Locking doors
Starting music
Updating UI
Progression hooks
Runtime Behavior & Lifecycle
Initialization & Registration
OnEnable
Assigns
TriggerZoneResets local state
Subscribes to
RuntimeSpawner.onSpawnerInit
Start (Play Mode)
Finds RuntimeSpawner
Registers via
RegisterWaveTrigger(this)Optionally auto-starts if
startAutomaticallyis enabled
OnDisable / OnDestroy
Unsubscribes from spawner events
Unregisters from RuntimeSpawner
Activation Flow
UnityPhysics Mode
OnTriggerEnterchecks:Correct tag
Spawner initialized
Not already activated
Calls
StartWave()Optionally schedules reset
External Mode
Unity triggers are ignored
External driver:
Sets inside state
Decides when to activate/reset
Calls public API methods
Reactivation
If reactivateTrigger is enabled:
Trigger schedules a reset after
reactivateTimeOn reset:
IsActivatedbecomes falseReset events fire
Trigger becomes eligible again
Typical Usage Patterns
1. One-Shot Encounter Volume
startAutomatically = falsereactivateTrigger = false
Player enters:
Trigger activates
Wave plays once
Trigger never fires again
2. Repeatable Horde Zone
reactivateTrigger = truereactivateTime = 30
Player enters:
Wave starts
After completion + cooldown, trigger resets
Can be reactivated on re-entry
3. Auto-Start Survival Wave
startAutomatically = trueOptional reactivation
On play:
Trigger waits for RuntimeSpawner
Wave starts automatically
No collider required
4. Manual Activation via Script (Updated)
This uses the same internal path as volume-based activation.
5. Global Monitoring (UI / Audio / Director)
Editor Helpers
AddSpawnpoint()
Creates a new child WaveSpawnPoint and selects it.
ShowHide(bool)
Controls whether the trigger volume gizmo is drawn.
OnDrawGizmos
Draws the trigger volume
Uses a distinct color when activated
Key Takeaways (1.6.0)
WaveTrigger is now API-driven, not state-mutable
Supports offline-first + deterministic networking
Clear separation between:
Occupancy (inside)
Activation (wave lifecycle)
Rich UnityEvents for designers
Clean integration path for Fusion and PUN drivers
Last updated