-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation
To create an object pool, simply add an ObjectPool component to any actor or use the Add Component by Class function.
- SpawnPoolObjectsOnBeginPlay - Specifies whether the pool should be filled at BeginPlay time. If false you have to fill it yourself during the game using AddActorsToPool function.
- PoolActor - Specifies what class of actors to be in the pool. It cannot be changed during the game.
-
InitialPoolSize - If the variable SpawnPoolObjectsOnBeginPlay is true, as many actors will be created as this variable is set to.
-
Add Actors to Pool & Simple Add Actors to Pool
Both functions are used to add actors to the pool. The difference is only in the outputs.
-
Spawn Actor from Pool
Returns and "spawns" an actor from the pool. If the pool is empty or all in use and the input variable "SpawnActorIfPoolIsEmpty" equals false the function will return nullptr.
This function: show an actor, enable collisions, and turns on tick.
-
Return Actor to Pool
Function that returns actor back to the pool.
This function: hide an actor, disable collisions, and turns off tick.
-
Get Active/Inactive Actors from Pool
Functions that returns array of active/inactive actors in the pool.
-
Has Pool Free Actor
Returns whether the pool has at least one free actor.