Description

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.

Steps to Reproduce
  1. Open UE4 Editor (blank code)
  2. Add code to project based on Actor (MyActor)
  3. In MyActor.cpp, add the following to the constructor
    	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)));
    
  4. Compile and launch editor in VS debug mode (F5)
  5. Add instance of MyActor class to the level

Result:
Ensure triggers when the instance is dragged from CB into the viewport

Callstack

[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.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Won't Fix
ComponentUE - Graphics Features
Affects Versions4.11.24.12
Target Fix4.13
CreatedMay 20, 2016
ResolvedMay 23, 2016
UpdatedMay 2, 2018