i have setup-ed a simple c++ code with the Hierarchical instanced static mesh.
// in constructor
static ConstructorHelpers::FObjectFinder<UStaticMesh> MountainMesh(TEXT("StaticMesh'/Game/Voronoi/Monkey.Monkey'"));
MountainSpawner = CreateDefaultSubobject<UHierarchicalInstancedStaticMeshComponent>(TEXT("MountainSpawner"));
MountainSpawner->RegisterComponent();
MountainSpawner->AttachTo(RootComponent);
MountainSpawner->SetStaticMesh(MountainMesh.Object);
for (int32 a = 0; a < 10; a++) {
FRotator rotate = FRotator(0, FMath::RandRange(0, 360), 0);
FVector Location = FVector(FMath::RandRange(0, SurfaceWidth*MapScale), FMath::RandRange(0, SurfaceHeight*MapScale), FMath::RandRange(-200, 0));
int32 XYScale = FMath::RandRange(5, 12);
FVector Scale = FVector(XYScale, XYScale, XYScale);
MountainSpawner->AddInstance(FTransform(rotate, Location, Scale));
}
the last entry before the error in the log showed:
[2016.09.13-10.47.30:672][731]LogWindows:Error: Assertion failed: !IsAsyncBuilding() [File:D:\Build++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\Engine\Private\HierarchicalInstancedStaticMesh.cpp] [Line: 2564]
I have no idea what is that!
It appeared fine in editor but crashed during play. Can someone point to what is wrong? Is it in the code or HISMC itself?