Preloading for InstancePlaceholders

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By avencherus

I’m optimizing a level, and I was wondering if there is some built-in way to preload a scene that is flagged as an InstancePlaceholder in the editor.

At the moment I have to manually write a bunch of preload statements into a script, and this is a bit far from ideal.

I’m working in 2.1.4.

Seems at least can make an export (PackedScene) var and individually set them too, still wondering if there is a better way.

avencherus | 2018-03-11 21:05

:bust_in_silhouette: Reply From: bitwes

Not sure if there is a proper way but you could probably loop through the tree and find all the ones that are placeholders and preload that way. Saves some typing.

If you mean in during runtime it wouldn’t work. Preloading requires a constant as the path. It has to know the path before the script executes in the tree.

I’m hoping for some built in option that I may be missing that will put this path information into the scene file for me.

avencherus | 2018-03-12 07:14

Forgot about that, I was thinking of load.

bitwes | 2018-03-12 22:15