Adding multiple instances to instance static mesh component in a code class causes an ensure to trigger when an instance of the class is added to the level.
USphereComponent* SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent")); RootComponent = SphereComponent; UInstancedStaticMeshComponent* ParticleVisualization = CreateDefaultSubobject< UInstancedStaticMeshComponent>(TEXT("ParticleVisualization")); FName Path("/Engine/BasicShapes/Sphere"); UStaticMesh* sphereMesh = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, *Path.ToString())); ParticleVisualization->SetStaticMesh(sphereMesh); ParticleVisualization->AttachTo(RootComponent); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(-5.6526e+07, 5.6523e+07, -3561.12), FVector(0.4f, 0.4f, 0.4f))); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(-5.68537e+07, -4066.15, 5.68518e+07), FVector(0.4f, 0.4f, 0.4f))); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(-5.77781e+07, 32644.8, -5.77864e+07), FVector(0.4f, 0.4f, 0.4f))); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(-5.81239e+07, -5.81233e+07, 15821.5), FVector(0.4f, 0.4f, 0.4f))); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(-56.2229, 11.118, 199.461), FVector(0.4f, 0.4f, 0.4f))); ParticleVisualization->AddInstance(FTransform(FRotator(0, 0, 0), FVector(5.65258e+07, -5.6523e+07, 4072.48), FVector(0.4f, 0.4f, 0.4f)));
Result:
Ensure triggers when the instance is dragged from CB into the viewport
[2016.05.19-14.54.56:196][ 93]LogEditor: Attempting to add actor of class 'CrashingActor' to level at -180.00,-310.00,20.00
Ensure condition failed: false [Link Removed] [Line: 266]
FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Graphics Features |
---|---|
Affects Versions | 4.11.2, 4.12 |
Target Fix | 4.13 |
Created | May 20, 2016 |
---|---|
Resolved | May 23, 2016 |
Updated | May 2, 2018 |