> For the complete documentation index, see [llms.txt](https://horizongames.gitbook.io/actorio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizongames.gitbook.io/actorio/logic-actors/logic-spawner.md).

# Logic Spawner

<div align="left"><figure><img src="https://1586816513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJUOUKxX4X7uzzyzY7fQb%2Fuploads%2FtJsQeBaxWpAD8vLGevu2%2FLogicSpawner_64.png?alt=media&amp;token=f00d52fd-474e-4238-a870-358a57bf2d04" alt=""><figcaption></figcaption></figure></div>

An actor entry for the logic spawner.

| Events            | Description                                                                      | Named Arguments                  |
| ----------------- | -------------------------------------------------------------------------------- | -------------------------------- |
| OnActorSpawned    | Event whenever a new actor is spawned.                                           | `$Actor`: Reference to the actor |
| OnSpawnFinished   | Event when all actors have finished spawning.                                    | -                                |
| OnGetSpawnedActor | Event when getting a spawned actor using the 'GetSpawnedActorForEntry' function. | `$Actor`: Reference to the actor |

| Functions                              | Description                                                                            | Parameters         |
| -------------------------------------- | -------------------------------------------------------------------------------------- | ------------------ |
| SpawnActors                            | Spawn the actors.                                                                      | -                  |
| DestroySpawnedActors                   | Destroy all spawned actors.                                                            | -                  |
| <p>DestroySpawnedActorFor<br>Entry</p> | Destroy the actor that was spawned for the given entry.                                | <`int32` EntryIdx> |
| GetSpawnedActorForEntry                | Get the actor that was spawned for the given entry and fire 'OnGetSpawnedActor' event. | <`int32` EntryIdx> |
