is it possible to set as instanceplaceholder from code

Godot Version

godot 4.4.1.stable

Question

I want to make a 2d project with a large map so I’m chunking it using instance placeholder and loading in the chunks with the resource loader. This seems to work flawlessly for making a seamless map but I’m concerned about having to keep the placeholder chunks active in one scene in the editor.

Is it possible to set a scene instanced from code as an instance placeholder?

You can use Node.set_scene_instance_load_placeholder() but that won’t change that the scene is active in the editor. That’s the whole point of InstancePlaceholder.

Turning on the option Load As Placeholder for an instantiated scene in the editor causes it to be replaced by an InstancePlaceholder when running the game, this will not replace the node in the editor.