Destructible Components

Was managed to get more detailed info to end of the day, the source of problem:


Exception thrown: read access violation.
NewMesh->ApexDestructibleAsset was nullptr.

But this doesn’t make any sense, at least i don’t get it.

Guy here had same problem: https://forums.unrealengine.com/deve…lptr-apexasset

Update:
Managed to fix it, basicly y just need to load your asset dynamicly, not in constructor, like so… for example:


UDestructibleMesh* Mesh = LoadObject<UDestructibleMesh>(NULL, TEXT("DestructibleMesh'/Game/SomeContent/Models/Sphere_DM.Sphere_DM'"));

According to info from here you can use:



 UClass* Result = StaticLoadClass(UObject::StaticClass(), nullptr, *ClassName, nullptr, LOAD_None, nullptr); 

to load FString, tho i didn’t get how to use it properly for this case probably cause of luck of knowledge of ue4 engine api and normal example, anyway first way should work.