Hey folks,
I have a problem which I just can’t seem to fix. I went trough the whole internet and still wasn’t able to find a solution to my problem. I basically just want to create a PoceduralmeshComponent at runtime. My current method works just fine, however when I try it in an packaged build it just crashes. Here is my code:
for (int i = 0; i < Objects.Num(); i++) {
ProcMesh = NewObject<UProceduralMeshComponent>(this, UProceduralMeshComponent::StaticClass());
if (ProcMesh) {
ProcMesh->RegisterComponent();
ProcMeshComp.Add(ProcMesh);
if (ProcMeshComp[i]) {
ProcMeshComp[i]->AttachToComponent(RootComponent.Get(), FAttachmentTransformRules::KeepRelativeTransform);
ProcMeshComp[i]->CreationMethod = EComponentCreationMethod::Instance;
}}}
There is no error message in the log, it just says "Fatal Error". However by bruteforcing my way trough I figured out that maybe "RegsisterComponent" is the problem. Please help me :)