Hello,
this crash happens with 4.11.2 on Windows 7 x64.
I have a custom actor with a UInstancedStaticMeshComponent attached to a USphereComponent as root.
As Mesh I use “/Engine/BasicShapes/Sphere”.
When I add a special combination of instances to this UInstancedStaticMeshComponent the editor crashes with the following error:
[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 [File:d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\public\math\UnrealMatrix.h] [Line: 266]
FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.
UE4Editor.exe has triggered a breakpoint.
Asking google lead me to the following Bug report which lacked a reproducible example: https://answers.unrealengine.com/questions/329760/crash-because-of-nan-dynamic-shadows-related.html
I have created a test project which crashes always on my machine. It just includes a custom class “CrashingActor”. Trying to place an instance of that class in a level using the editor leads to a crash with the above error.
I couldn’t narrow the error down to a single instance. It is somehow related to an interaction between these instances. I know that the coordinates are quite unrealistically to be ever used in production. This is just the (reduced) output of a particle simulation gone wild. But I didn’t expect a crash until I threw NaNs at it.
I hope I am using everything correctly.
The project is just a stripped down standard-project with a custom actor which has in the constructor:
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
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)));
Thanks in advance for the help!