Hello Everyone …
i actually don´t know if i am doing something wrong or this is just a weird bug.
But when i try to spawn an actor and afterwards try to save it in an array it just does not spawn.
Here the code:
UPROPERTY( BlueprintReadWrite, Category = Test)
TArray<Voxel*> VoxelList;
Voxel* SpawnedVoxel=
GetWorld()->SpawnActor<Voxel>(VoxelToSpawn, SpawnLocation, FRotator());
if (SpawnedVoxel)
{
GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Orange, SpawnedVoxel->GetName());
}else {
GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Orange, TEXT("not spawning"));
}
// VoxelList.Add(SpawnedVoxel);
So the voxel gets spawned if i dont use
VoxelList.Add(SpawnedVoxel);
Am i doing something wrong here?