On Button click at editor mode I am trying to make a scene of selected Hierarchy game-object but the problem is as i click the button new scene become upon and I lost the scene where i were selected the Game-object. My code given below:

 if (GUILayout.Button("Generate Scene"))
            Scene newScene = EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects);;
            SceneManager.MoveGameObjectToScene(Selection.activeGameObject, newScene);
            EditorApplication.SaveScene("Assets/RegionScene/" + gameObjectSelected[gameObjectSelected.Count - 1].name + ".unity"); //newScene

  • \$\begingroup\$ ...and what would you like to happen instead? \$\endgroup\$
    – Philipp
    May 6, 2016 at 14:27

1 Answer 1


Sounds like you want to use NewSceneMode.Additive to create the new scene without discarding the currently open scene(s).

Pass this as the second parameter of the NewScene() method.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .