1. Home
  2. Unity RTS Engine
  3. Units
  4. NPC Unit Spawner

NPC Unit Spawner

The NPC Unit Spawner component allows the NPC faction to create units that can not be created using the other 3 main components (healers and converters for example).

This component is optional and it’s not required for a NPC faction.

  1. Faction ID: The faction ID that this component belongs to.
  2. Units (array): This array allows you to define units that this component will spawn for the NPC faction. Each element of the array represents a unit and its spawn options:
    1. Prefab: The unit prefab to spawn.
    2. Population Ratio: Defines the amount of this unit in relation to the maximum population amount (between 0 and 1).
    3. Start Creating After: Time (in seconds) that the faction needs to wait before starting to create this unit. This allows you to set the priority of creating this particular unit.
    4. Spawn Reload: Time required between each time the NPC faction looks into spawning this unit.

How can we help?