I make this blend for show the problem:
objectFromAnotherScene.blend (102 KB)
An empty run this script in the overlay scene “overLayScene”:
import bge overLayScene = bge.logic.getCurrentScene() mainScene = [scene for scene in bge.logic.getSceneList() if scene.name == "mainScene"] objectFromAnotherScene = mainScene.objectsInactive["objectFromAnotherScene"] overLayScene.addObject(objectFromAnotherScene, "spawn")
The purpose is spawn the object “objectFromAnotherScene”(it is in the main scene) in the overlay scene “overLayScene”, it use the object “spawn”(it is in the overlay scene) for spawning.
At the start an empty add the “overLayScene”.
The problen is the console returns the error “object must be in an inactive layer”, but the object “objectFromAnotherScene” is already in an inactive layer.
Trying to make it in the “mainScene” with another script produce the same error.
What i am trying to make is spawn an object (this object is loaded using LibLoad, so it appears in the main scene, i guess it happen because the script that do the dynamic loading is in the main scene) in a overlay scene when the player pickup an item.
It is really important for my fix the problem! it is stopping me, Thanks and I hope someone can help me.