Getting Started Guide (Version 1.14)

Creating AI Spawn Points

You can use AI spawn points to define the exact location that an enemy AI appears in the level when activated.

To create AI spawn points

  1. In the viewport, right-click in the center of your maze and choose Create entity.

  2. In the Entity Inspector, name the new entity AiSpawnpoint01.

  3. Click Add Component. Under the Gameplay category, click the Spawner component.

  4. In the Spawner component, next to Dynamic slice, click (...).

  5. In the Pick Dynamic slice window, navigate to StarterGame\slices. Select ai_slice.slice and click OK.

  6. Add a Lua Script component to the AiSpawnpoint01 entity. To do this, make sure the AiSpawnpoint01 entity is still selected in the Entity Outliner. And then in the Entity Inspector, click Add Component and then click Lua Script.

  7. To add the script to the Lua Script component, next to Script, click (...). Navigate to StarterGame\Scripts\AI. Select AISpawner.lua and then click OK.

  8. In the Lua Script component's GroupId box, type Group0.

    This links the Spawner component on this entity to the AiTrigger entity's Lua Script component, telling the trigger what group ID to spawn.

  9. Press Ctrl+S to save your level.

Next: Adding Patrol Waypoints