I’m trying to spawn 3d grids of cubes like so:
`
void AMultiCubeSpawnner::BeginPlay()
{
Super::BeginPlay();
FVector Location(0.0f, 0.0f, 0.0f);
FRotator Rotation(0.0f, 0.0f, 0.0f);
FActorSpawnParameters SpawnInfo;
for (float x=-2; x<3; x++)
for (float y=-2; y<3; y++)
for (float z=-2; z<3; z++)
{
Location = FVector(x*10.f, y*10.f, z*10.f);
GetWorld()->SpawnActor<AFloatingActor>(Location, Rotation, SpawnInfo);
}
}`
They all spawn at the exact same point.
Also, the log states:
LogActor: Warning: FloatingActor /Game/StarterContent/Maps/UEDPIE_0_Minimal_Default.Minimal_Default:PersistentLevel.FloatingActor_0 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
can’t figure out why they’re all at the same point. Little help??