# Unit Spawn Node

## Properties

| Name                    | Description                                                                                                                                                                                                                                                                                                                       |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Unit Profile Names      | [Unit Profiles](https://docs.anyrpg.org/scriptable-objects/unit-profile) of characters that will be spawned.                                                                                                                                                                                                                      |
| Dynamic Level           | If true, the spawned characters will be the same level as the player, instead of the default level set in the *Unit Level* field.                                                                                                                                                                                                 |
| Unit Level              | The level the characters will be set to, if *Dynamic Level* is false.                                                                                                                                                                                                                                                             |
| Extra Levels            | If *Dynamic Level* is true, the characters will have this many more levels than the player.  This is used to guarantee some characters are always tougher than the player.                                                                                                                                                        |
| Default Toughness       | The [Toughness](https://docs.anyrpg.org/scriptable-objects/unit-toughness) the spawned characters will be.                                                                                                                                                                                                                        |
| Spawn Timer             | Spawn time for regular mob spawns, such as when [Prerequisites](https://docs.anyrpg.org/shared-properties/prerequisite-conditions) are updated, or the spawner supports multiple units and they should not all spawn at once.                                                                                                     |
| Spawn Delay             | An additional delay to add to the timer. meant to allow an offset for multiple spawners of the same type.                                                                                                                                                                                                                         |
| Despawn Delay           | An extra delay from the time the Destroy GameObject call is made before it is actually destroyed.                                                                                                                                                                                                                                 |
| Respawn Timer           | A separate spawn timer for when mob despawns are detected to give players longer to move away being a mob attacks them again. -1 disables respawning of despawned units.                                                                                                                                                          |
| Respawn On              | <p>An enumeration of options that controls when respawns will happen.<br><strong>Despawn</strong><br>Respawns will happen when a character despawns.<br><strong>Loot</strong><br>Respawns will happen as soon as a character is looted.<br><strong>Death</strong><br>Respawns will happen immediately upon a character dying.</p> |
| Max Units               | The maximum number of simultaneous units that can be spawned.  If this number is reached, additional spawns will be preented until the number of active characters falls below this number. Set to -1 to do infinite spawns.                                                                                                      |
| Suppress Auto Spawn     | Set to true to allow for [Unit Spawn Control Panels](https://docs.anyrpg.org/monobehaviours/interactable-options/unit-spawn-controller-interactable) to use this node.                                                                                                                                                            |
| Trigger Based           | If true, ignore spawn timers and use trigger instead.                                                                                                                                                                                                                                                                             |
| Trigger Limit           | The number of times this object can be triggered. 0 is unlimited.                                                                                                                                                                                                                                                                 |
| Spawn Density           | In area mode, the number of mobs per square meter to spawn.                                                                                                                                                                                                                                                                       |
| Point Based             | If true, units will spawn at the pivot of the Unit Spawn Node.                                                                                                                                                                                                                                                                    |
| Force Despawn Units     | If true, and there are units spawned, and the [Prerequisite Conditions](https://docs.anyrpg.org/shared-properties/prerequisite-conditions) are no longer met, despawn them.                                                                                                                                                       |
| Prerequisite Conditions | [Prerequisite Conditions](https://docs.anyrpg.org/shared-properties/prerequisite-conditions) that must be met for units to spawn.                                                                                                                                                                                                 |

## Dependencies

* If *Trigger Based* is set to true, then a Collider marked as a trigger is required on the same GameObject in order to detect when players enter the area.
