Error after export : Edit state is only for editors, does not work without tools compiled

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By c4n4r
:warning: Old Version Published before Godot 3 was released.

Hi there!

I need help.

I made a game that work nice when i launch it on Godot.
But after export, the console return me this line :

Edit state is only for editors, does not work without tools compiled

this is the script i try to call :

scene = load("res://portions/portion1.scn");
node = scene.instance(true);
add_child(node);
node.set_name("portion1");

i just want to load a portion of my level on the scene start.

Do you know what i did wrong?

regards!

:bust_in_silhouette: Reply From: Bojidar Marinov

(To copy myself from IRC)
The problem is that you are passing true to PackedScene::instance, which is available only in editor builds.

A quick fix would be to make just:

node = scene.instance();

yeah i saw your answer on IRC!

It’s working, you made my day thx a lot!

c4n4r | 2016-04-06 15:30