I’ve been trying some thing with unreal and I’m struggling on one.
I wrote a bit of code to make an editor plugin that generates custom actors asset (.uasset).
I have used this tutorial code for instance : https://docs.unrealengine.com/en-US/…art/index.html
I’m saving everything using these lines code:
AMyActor* myActor = NewObject<AMyActor>(Package, ObjectUName, RF_Public | RF_Standalone); myActor->FloatSpeed = 15.f; ...] Creating a mesh and other things Package->MarkPackageDirty(); bool bSaved = UPackage::SavePackage( Package, myActor, EObjectFlags::RF_Public | EObjectFlags::RF_Standalone /*| RF_ClassDefaultObject *//*| RF_NeedPostLoadSubobjects*/, saved *PackageFileName, GError, nullptr, true, true, SAVE_NoError);
It seems that the export works as I can vizualize my properties values (as you can see below, floatspeed = 15), I can’t load them though.
When I create a new asset from my new file, everything is zero’d (by the constructor it seems ?). I would like to keep my values.
I’ve tried ‘official’ classes : StaticMeshActor for instance, but same here, I can’t make the asset remember its staticMesh ! Same goes if I use a Factory instead of SavePackage.
I guess I have missed something ? Do you have any idea ?