Limen Framework 0.1 Help

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

TSubclassOf<AActor>

ClassToSpawn

EditDefaultsOnly

The class of actor to be spawned.

float

SpawnInterval

EditDefaultsOnly

The interval at which actors are spawned.

int32

MaxSpawns

EditDefaultsOnly

The maximum number of actors that can be spawned.

int32

MaxSpawnRetries

EditDefaultsOnly

The maximum number of retries to find a valid spawn location.

TArray<TWeakObjectPtr<AActor>>

SpawnedActors

Private

A list of weak pointers to the currently spawned actors.

Functions

Return Type

Signature

Description

void

StartTimer()

Starts a timer that triggers actor spawning at the specified interval.

void

StopTimer()

Stops the timer if it is active.

bool

IsTimerActive() const

Returns true if the timer is currently active.

bool

IsActorSet() const

Returns true if a valid actor class has been set to spawn.

void

DespawnAllActors()

Destroys all spawned actors and stops the timer.

TArray<TWeakObjectPtr<AActor>>

GetSpawnedActors()

Returns an array of weak pointers to the currently spawned actors.

bool

ShouldSpawn()

Determines whether an actor should be spawned. Default implementation always returns true.

bool

GetSpawnTransform(FTransform& OutTransform)

Calculates a valid spawn transform for the actor. Default implementation returns false.

FActorSpawnParameters

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 GetSpawnTransform and ShouldSpawn to customize the spawning logic.

  • Actors are despawned and the timer is stopped when DespawnAllActors is called.

22 May 2026