I wanting to spawn a random mesh from an array but I’m not quite understanding what to do.
I’ve got the below code:
Platform = ObjectInitializer.CreateAbstractDefaultSubobject<UStaticMeshComponent>(this, TEXT("Floor_StaticMesh")); static ConstructorHelpers::FObjectFinder <UStaticMesh>StaticMesh(TEXT("StaticMesh'/Game/Meshes/Floor_StaticMesh.Floor_StaticMesh'")); Platform->SetStaticMesh(StaticMesh.Object); RootComponent = Platform;
Which lets me spawn an actor with the below code in the GameMode class:
World->SpawnActor<ALevelGen>(ALevelGen::StaticClass(), FVector(0, 0, -400), FRotator(0,0,0));
I’m just not sure where to go from there? How would I actually spawn more than one from an array?