ULimenDynamicSpawnerComponent
Overview
ULimenDynamicSpawnerComponent is an abstract actor component that handles the logic for dynamically spawning actors. It provides functionality to start and stop a timer, check if the timer is active, and manage the spawned actors. Subclasses can override methods to customize the spawn behavior.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| ClassToSpawn | EditDefaultsOnly | The class of actor to be spawned. |
| SpawnInterval | EditDefaultsOnly | The interval at which actors are spawned. |
| MaxSpawns | EditDefaultsOnly | The maximum number of actors that can be spawned. |
| MaxSpawnRetries | EditDefaultsOnly | The maximum number of retries to find a valid spawn location. |
| SpawnedActors | Private | A list of weak pointers to the currently spawned actors. |
Functions
Return Type | Signature | Description |
|---|---|---|
| StartTimer() | Starts a timer that triggers actor spawning at the specified interval. |
| StopTimer() | Stops the timer if it is active. |
| IsTimerActive() const | Returns true if the timer is currently active. |
| IsActorSet() const | Returns true if a valid actor class has been set to spawn. |
| DespawnAllActors() | Destroys all spawned actors and stops the timer. |
| GetSpawnedActors() | Returns an array of weak pointers to the currently spawned actors. |
| ShouldSpawn() | Determines whether an actor should be spawned. Default implementation always returns true. |
| GetSpawnTransform(FTransform& OutTransform) | Calculates a valid spawn transform for the actor. Default implementation returns false. |
| GetSpawnParameters() | Returns the parameters to use when spawning an actor. Default implementation sets collision handling to always spawn. |
Usage & Implementation Notes
The component uses a timer to trigger the spawning of actors at regular intervals.
Subclasses can override
GetSpawnTransformandShouldSpawnto customize the spawning logic.Actors are despawned and the timer is stopped when
DespawnAllActorsis called.