Construction script clears blueprint variables

Simplified version of the problem.

I have a cylinder component and vector position variable with the widget set.

My custom ( run in editor ) event ‘Init’ point the variable at the cylinder and puts the location ( 0,0,0 ) in the variable.

WHY - when I then move the BP ( and the construction script runs ), does my reference to the cylinder get trashed?

( end of GIF notice the mesh name gets replaced with TRASH ).

302506-construct.gif

Init event:

Construct:

All components created in editor during construction (before begin play) get destroyed whenever construction script re-runs. This includes any arrays made during construction (via MakeArray). You have to re-create your component in Constvruction script. You could put your init there.

You can set your variable “Location” to bInstanceEditable = true, this ensures that the value is not reseted after you rerun the construction script.

I just tried it and in my case, even if the variable is Instance Editable and/or SaveGame it still gets reset to default value whenever Construction script runs (UE 5.0).