The Sample Scenes
Last updated
Last updated
There are a number of different sample scenes included with the Runtime Spawner Samples. Each demonstrates a single use case and the ‘Combined Example’ showcases how these various options can be used together in a more complicated example.
If any of the scenes does not look like the screenshots below, you might be using one of Unity’s Scriptable Render Pipelines (URP or HDRP) in your project. See the ‘SRP Support for Samples’ section, below for instructions on how to convert the samples to your chosen render pipeline.
Press Play in the Editor to view the sample.
You can control the character using the WASD keys and the camera by using the Mouse.
This is a simple example of spawning global AI objects anywhere on the navmesh in the scene.
This example showcases how to use the Local Area Spawner to only spawn AI Objects when the player enters a specific trigger volume within the scene.
The “New Spawn Region’ game object defines the spawning area and Spawn Entries to use.
This scene provides an example of a tower defense style ‘wave’ spawning system. The waves are triggered when the player enters the green ‘Wave Trigger’ and continue until completed.
The waves are triggered when the player enters the green ‘wave trigger’ and continue until completed.
The Wave Trigger defines a number of Wave Spawn Points which indicate where the AI Agents are spawned.
The waves themselves are defined in the Wave Spawner scriptable object, which specifies how many AI Agents to spawn, their frequency and which Spawn Entries to actually spawn.
This example combines all of the first 3 examples into a single master scene. Global AI Agents are spawned anywhere on the navmesh, Local Area spawners are spawned when the player enters the Local Area Spawner zone and Waves are spawned if the player enters the Wave Trigger zone.
This final example has a simple demonstration of using the Runtime Spawner public API. The StartRuntimeSpawner.cs script shows how to use the public API.