0 votes

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.

in Engine by (5,203 points)

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

1 Answer

0 votes

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.

by (141 points)

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.

Forgot about that, I was thinking of load.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.