This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
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,286 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 Frequently asked questions and 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 [email protected] with your username.