How do I re-run the construction script of an asset when I change a class default value from an editor utility widget?

Currently my editor utility widget is being used to update class default values in an asset via a c++ function library, however the changes that are made are not reflected on the actor in the viewport. The construction script is not getting re-run when values are changed with the widget.

However when I call Actor->ReRunConstructionScript() the editor crashes. Is there something I’m missing in this process?

Thanks :slight_smile:

by default the constructor(s) are called when the object comes into existence: on Editor load, on Load from File, and when the thing is spawned using some variety of ‘Create’ ‘spawn’ and the like. with a notable exception being a copy constructor but that is a separate thing usually reserved for data structures/containers.

so if you like changed the inheritance, that should be cleaned up by just triggering the Unreal Build Tool either through the IDE, or by launching the Uproject.

what I am presuming is that your ContructorScript() is doing some calculations, or setup that you now need/want to have go off again with the data that has been modified, for this you can just so happen to have the ConstructorScript() call a series of functions to do all the actual work, and then when you condition to “reconstruct” comes up you just call those same series of functions.

if this doesn’t help and you still get a crash then, what is your “reRunContructionScript()” doing?