ULimenRandomMeshInstance
Overview
ULimenRandomMeshInstance is a component that extends ULimenMeshInstanceBuilder. It randomly spawns multiple instances of a specified static mesh within a defined area, with customizable rotation and scaling parameters. This component utilizes the ULimenGlobalRandomStreamSubsystem to generate random values for positioning, rotation, and scaling.
Properties
Type | Name | Access | Description |
|---|---|---|---|
uint16 | NumberOfInstances | EditAnywhere | Number of instances to spawn. Default is 1. |
FRotator | MaxRotation | EditAnywhere | Maximum rotation values for each instance. |
FRotator | MinRotation | EditAnywhere | Minimum rotation values for each instance. |
float | MaxScale | EditAnywhere, meta=(ClampMin="0") | Maximum scale factor for each instance. Default is 1.0. |
float | MinScale | EditAnywhere, meta=(ClampMin="0") | Minimum scale factor for each instance. Default is 1.0. |
TArray<TSoftObjectPtr > | StaticMeshes | EditAnywhere | Array of static meshes to choose from when spawning instances. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | StartSpawningInstances() | Starts the process of spawning instances based on the configured parameters. |
TArray | CalculatePoints() const | Calculates random points within the defined area for instance placement. |
void | SpawnInstances() | Spawns instances at calculated points with randomized rotation and scaling. |
Usage & Implementation Notes
This component requires the
ULimenGlobalRandomStreamSubsystemto function correctly.The
NumberOfInstances,MaxScale,MinScale, andStaticMeshesproperties can be adjusted in the Unreal Editor to control the behavior of instance spawning.Instances are spawned with random rotations and scales within the specified ranges.