Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Infinitusvoid/ac203439ec5f19a0197478910e5b3495 to your computer and use it in GitHub Desktop.
Save Infinitusvoid/ac203439ec5f19a0197478910e5b3495 to your computer and use it in GitHub Desktop.
Unity C# : How to create a scene in runtime and move objects to separate scene?
//using UnityEngine.SceneManagement;
//Create a scene and move Object to sepeate scene?
Scene pool_scene = SceneManager.CreateScene("PoolScene");
for (int i = 0; i < list_of_gameobjects.Count; i++)
{
SceneManager.MoveGameObjectToScene(
list_of_gameobjects[i], pool_scene
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment