Construction Script Bug

Construction Script runs more than once on some calls. It seems like this problem has been around for a while. Anyone else able to reproduce?

What calls and classes are you referring to? Are you getting this in a packaged game? If you run the game from within the editor you can get the constructor executed for many different reasons.

UObjects might have Archetype, Asset, DefaultObject, In-Editor Instance and Runtime Instances…

All of them are the same class and all of them will execute class Constructor function.

Inside Constructor you can check if object is marked any of those flags to know which layer of your class it is, for example:



if ( HasFlags( RF_Archetype | RF_DefaultObject ) ) {  return;  }

//... do code as usual