[Closed] Running BP construction scripts at Package Time
We have procedural assets in our maps which are created by Blueprints. At construct time objects are spawned and placed in the map. This allows us to configure our map in different ways, and iterate quickly in editor.
The downside is that package builds take a while to start up because all of the construction scripts running.
Is it possible to package the game, so that the construction scripts run at package time, so when we run our final build the construction doesn't need to happen so our maps load & start faster?
The question has been closed Mar 03 '16 at 09:05 PM by Stephen Ellis for the following reason:
The question is answered, right answer was accepted
Unless something has regressed, objects pre-placed in a level have their construction scripts ran at cook/"package" time. They are solidified in the level during that process. This is to address the exact concerns you've brought up.
Dynamically spawned objects however will run their constructions scripts as they're created. Events like BeginPlay, where some setup/initialization script can be placed will also be executed at runtime, so be mindful of that.
Are you seeing specific evidence that construction scripts for pre-placed level objects are being ran in cooked builds? Note that running the editor with -game is still an editor build, so expect constructions script to be ran there as well.
answered Mar 03 '16 at 09:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here