Download

Is the construction script invoked at runtime before BeginPlay()?

The title might be confusing so let me elaborate - when my object is created in memory, does it run its construction script? Or are the modifications the construction script makes “cached” somewhere and don’t have any additional runtime cost?

If placed in level, construction won’t invoke at runtime

If spawned, it will

Is there any documentation about this? It seems like a really weird thing that there is no initialization cost to the Construction script.

You’re right, that is weird.

I was wrong. If you play in editor, then the construction info is ‘cached’, however if you play standalone then construction is invoked

My bad. Try it out… Just have a construction script change an item randomly in some way (I did scale), then you’ll see the items are changed when you launch standalone (or spawn)

Well that’s a bummer. I was hoping it’s getting serialized into the level file. Oh well, good to know either way.

Yeah lots of construction scripts will slow down the loading of your level. Depending on what you are doing with the construction scripts you can alternatively create blueprint functions which you run in the editor, do them during run simulation and then save those results out to be a part of the actor itself.