Hello, I am using some simple C++ code for creating runtime instanced static mesh components.
My code worked great until 4.17.1, but since I upgraded to 4.17.2 today it just crashes.
Since I was unable to understand much (callstack at the end) I also tried upgrading to 4.18 preview but the crash still occurred.
My project is quite extensive so I don’t think I can give exact steps to reproduce but I will include the code that if I comment out stops the crash.
This is how I create my component: (this is done at runtime)
NewComp = NewObject<UInstancedStaticMeshComponent>(this, name);
NewComp->SetStaticMesh(mesh);
NewComp->AttachToComponent(PlanetCenter, FAttachmentTransformRules::SnapToTargetIncludingScale);
NewComp->RegisterComponent();
and this is how I add an instance again during runtime - commenting this out stops the crash (even if the component is created)
Comp->AddInstance(FTransform(rot, loc, scale));
I guess that this is common stuff.
Now the crash happens in Windows\D3D11RHI\Private\D3D11VertexDeclaration.cpp, line 54 (“Unknown RHI vertex element type 0”)
Full stack trace here: > [Inline Frame] UE4Editor-D3D11RHI.dll!FWindowsPlatformMisc::DebugBreak() Line - Pastebin.com
I tried switching my mesh just in case my materials were a problem - but it still happens everytime.
I would appreciate any help, even a workaround, since my game is broken atm…
Thanks in advance