Runtime Spawner

Runtime Spawner

The Runtime Spawner component is the master controller for the package. It owns the spawning lifecycle and coordinates:

  • Global spawning (ambient population within world extents)

  • Region spawning (proximity-based biomes via LocalAreaSpawner)

  • Wave spawning (encounter tables via WaveTrigger)

  • Optional systems like Spawn Hints, culling, and pool expansion budgeting

  • Optional network factory integrations (Fusion / PUN) via the Factory Asset

The inspector is organized into foldouts that match the runtime architecture.


Adding a Runtime Spawner

To add a Runtime Spawner into your scene:

  • Right-click in the Hierarchy → Runtime Spawner → Runtime Spawner (Full Stack)

This creates a configured GameObject that includes the common companion components (e.g., Spawn Director / Special Encounter Manager depending on your template).


How the Inspector Is Organized

The RuntimeSpawner inspector shows only the features you enable. It is organized into these foldouts:

  1. Global Settings

  2. Global Spawners

  3. Region Spawners (Biomes)

  4. Wave Spawners

  5. Spawn Hints

  6. Debug & Gizmos

Each foldout below maps directly to the inspector UI.


Global Settings

This foldout defines the overall session setup, global limits, factory selection, determinism, and optional internal culling.

Auto Launch on Start

If enabled, the spawner will start automatically on Start(). If disabled, you start the spawner yourself:

Player Object

Reference to the player object used for range checks, culling, and spawn context. If left empty, the spawner falls back to MainCamera.

At runtime you can assign it:

Player Tag

Optional tag used by helper systems (and some trigger workflows) to identify the player. Default is "Player".

Factory

Controls how objects are spawned and despawned.

  • If no asset is assigned, the spawner defaults to the built-in Single Player Pool behavior.

  • Assigning a Factory Asset enables swapping between:

    • Offline pooled spawning

    • Fusion spawning (NetworkRunner)

    • PUN spawning (PhotonNetwork)

Factory Asset

  • The assigned ObjectFactoryAsset (or equivalent) that provides the runtime factory implementation.

World Extents

Defines the playable bounds for spawning and debug visualization.

  • World Extents field controls the size

  • Show/Hide button toggles the gizmo

Minimum Spawn Range

Minimum distance from the player where spawns may appear.

If Internal Culling is enabled, this should remain less than Cull Distance.

Max Global Population

Hard cap on total alive objects across all spawn flows (global + region + wave + encounters).

Pool Expansion Budget / Frame

Limits how many pooled instances can be instantiated per frame when pools expand at runtime.

  • Higher budget = faster population catch-up

  • Lower budget = smoother frame pacing

Deterministic Spawning

Controls reproducibility using a single global seed.

  • Use Deterministic Seed

  • Global Seed (+ Randomize / Copy / Apply Now in play mode)

With determinism enabled, spawn placement and counts are reproducible for a given seed (as long as you set it before starting spawns in your bootstrap).

Use Internal Culling

Enables distance-based despawning for spawned objects.

If enabled:

  • Culling Range (CullDistance)

  • Culling Check Frequency

  • Preview button to visualize the culling radius

Spawner Tag

Optional tag to apply to spawned objects.


Global Spawners

Global spawners maintain ambient population anywhere valid within world extents.

Use Global Spawners?

Enables the global spawn loop and shows global spawn configuration.

Create (Spawn Entry)

Creates a new SpawnEntry asset from the inspector.

Global Spawners (List)

List of SpawnEntry assets used for global spawning.

Restrict to Navmesh Areas

Optional list of NavMesh area names that global placement is allowed to use.

Layer Mask

Restricts spawn placement to specific scene layers.

Min / Max Global Object Count

Population window for global spawning. The spawner maintains population between these values unless overridden by Max Global Population.


Region Spawners (Biomes)

Region spawners maintain population in authored volumes while the player is nearby.

Use Region Spawners (Biomes)?

Enables region spawning support.

Init

Finds region spawners and registers them. (Per your current inspector wording, this is presented as “Find & Init Local Area Spawners”.)

Spawn Regions (List)

List of LocalAreaSpawner components used as region volumes.

Create New Region (Child)

Creates a new LocalAreaSpawner child object and assigns it into the list.

Show / Hide

Toggles visualization for region spawn volumes.


Wave Spawners

Wave spawners drive scripted encounters via triggers.

Use Wave Spawners?

Enables wave spawning support.

Wave Spawner Configs (List)

List of wave configurations used by triggers (depending on your asset/workflow).

Wave Triggers (List)

List of WaveTrigger components used to activate wave sequences.

Create New Wave Trigger (Child)

Creates a child GameObject with a WaveTrigger and assigns it into the list.

Show / Hide

Toggles visualization for wave triggers.


Spawn Hints

Spawn Hints allow designers to steer placement using authored hint points before falling back to sampling.

Use Spawn Hints

If enabled, spawns prefer SpawnHintPoint locations (based on your SpawnHintSettings).

Hint Settings

Reference to a SpawnHintSettings asset controlling:

  • search radius

  • reservation rules

  • LOS rules (denyLineOfSight, etc.)

  • player distance constraints

Create Spawn Hint Settings

Creates and assigns a SpawnHintSettings asset if one is missing.


Debug & Gizmos

This foldout focuses on visualization, logging, and runtime playmode controls.

Gizmo Visualization

World Extents Gizmo

Toggles world bounds drawing.

Region Spawn Volumes

Toggles LocalAreaSpawner volume gizmos.

Wave Trigger Volumes

Toggles WaveTrigger volume gizmos.

Logging

Log Entries to the Console

Logs spawner activity to the Unity console.

Runtime Controls (Play Mode Only)

  • Start (Start enabled spawn loops)

  • Pause / Resume

  • Stop (stop loops, keep objects unless despawn is requested)

Also displays a simple state line (Not Initialized / Running / Paused).

Playmode Stats (Play Mode Only)

Displays:

  • Global population

  • Region count

  • SpawnedObjects list (read-only)


Fundamentals

RuntimeSpawner is the main entry point that coordinates all spawn flows and enforces global population limits.

It also provides:

  • pooling / lifecycle bridge through the Factory system

  • optional internal culling

  • optional hint-based placement

  • API methods for driving and tuning spawn behavior


Typical Usage

Start on Host / Authority

In multiplayer, the authoritative instance runs the spawner (host/server/master depending on backend).

Assign Player at Runtime

Stop and Clear World


Last updated