Spawner Component: Difference between revisions
Jump to navigation
Jump to search
(Initial content) |
(Removed known issues) Tag: Manual revert |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
The spawner component is a [[:Category:Gameplay Components|gameplay component]] that can spawn [[Prefab|prefabs]]. | The spawner component is a [[:Category:Gameplay Components|gameplay component]] that can spawn [[Prefab Asset|prefabs]]. | ||
== Component Settings == | |||
[[File:SpawnerComponent.png|thumb|500px|The Spawner component in the [[Inspector Window]]. This example will spawn one of three prefabs at one of two locations, and not spawn another until the first is destroyed.]] | |||
{| class="wikitable" | |||
|- | |||
! Property !! Description | |||
|- | |||
|'''Type''' || When should the spawner spawn something. | |||
|- | |||
| style="padding-left: 2em;" | ''Always Spawn'' || Spawns prefabs repeatedly. | |||
|- | |||
| style="padding-left: 4em;" | '''Interval''' || The time between each prefab being spawned by the spawner. Can be set as a constant or a random time between two values. | |||
|- | |||
| style="padding-left: 2em;" | ''Spawn On Destruction'' || Spawns a prefab once the last spawned prefab is destroyed. | |||
|- | |||
| style="padding-left: 4em;" | '''Delay''' || The ''Delay'' before the prefab is spawned when this spawner is destroyed. Can be set as a constant or a random time between two values. | |||
|- | |||
|'''Spawn Count''' || How many prefabs should be spawned at once. | |||
|- | |||
| '''Prefabs''' || A list of prefabs to spawn. The prefabs will be chosen randomly from this list. | |||
|- | |||
|'''Locations''' || Defines where prefabs are spawned. | |||
|- | |||
| style="padding-left: 2em;" | ''OnSpawner'' || Spawns prefabs on the position of this gameobject. | |||
|- | |||
| style="padding-left: 2em;" | ''OnTargets'' || Spawns prefabs on the provided list of ''Spawn Points''. | |||
|- | |||
| style="padding-left: 4em;" | '''Spawn Points''' || A list of transforms that will be used as spawn points for the prefabs. | |||
|- | |||
|} | |||
== Example Usage == | |||
Spawners can be used to continuously spawn items or collectables for points. | |||
Using ''Spawn on Destruction'' can essentially "respawn" a prefab once it's destroyed. Using the random mode of the spawn delay can make this use case more interesting. | |||
Note: Be careful when using a low ''interval'' value with ''Always Spawn''. Many objects will be spawned in the same position and may cause the game to lag. | |||
[[Category:Gameplay Components]] | [[Category:Gameplay Components]] | ||
[[Category:Components]] | [[Category:Components]] |
Latest revision as of 03:37, 25 January 2023
The spawner component is a gameplay component that can spawn prefabs.
Component Settings
Property | Description |
---|---|
Type | When should the spawner spawn something. |
Always Spawn | Spawns prefabs repeatedly. |
Interval | The time between each prefab being spawned by the spawner. Can be set as a constant or a random time between two values. |
Spawn On Destruction | Spawns a prefab once the last spawned prefab is destroyed. |
Delay | The Delay before the prefab is spawned when this spawner is destroyed. Can be set as a constant or a random time between two values. |
Spawn Count | How many prefabs should be spawned at once. |
Prefabs | A list of prefabs to spawn. The prefabs will be chosen randomly from this list. |
Locations | Defines where prefabs are spawned. |
OnSpawner | Spawns prefabs on the position of this gameobject. |
OnTargets | Spawns prefabs on the provided list of Spawn Points. |
Spawn Points | A list of transforms that will be used as spawn points for the prefabs. |
Example Usage
Spawners can be used to continuously spawn items or collectables for points.
Using Spawn on Destruction can essentially "respawn" a prefab once it's destroyed. Using the random mode of the spawn delay can make this use case more interesting.
Note: Be careful when using a low interval value with Always Spawn. Many objects will be spawned in the same position and may cause the game to lag.