Search Unity

Can't Find Subscene Creation

Discussion in 'Editor & General Support' started by DavidWIV, Jun 29, 2022.

  1. DavidWIV

    DavidWIV

    Joined:
    Jun 8, 2022
    Posts:
    1
    I've seen tutorials using it, I've searched documentation, but I can't figure out how to create subscenes. I don't have the option in the places I've seen others have it.
    I have a 2D project using URP. Is there a specific package I need to install?
    Things I've tried:
    Context menu in "Hierarchy," searching literally every option.
    Context menu while highlighting multiple objects in "Hierarchy."
    Context menu in "Project," searching literally every option.
    Creating a scene and trying to drag it into/under another scene.

    I'm trying to accomplish seamless loading and unloading of levels or areas as the player moves around, as an open world would. Could I accomplish this with Grids as a sort of pseudo-subscene?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    AFAIK there's just scenes.

    I suppose a scene could be called a subscene if it needs others to function.

    This would mean it would be additively loaded.

    Here's a blurb about it:

    Additive scene loading is one possible solution:

    https://forum.unity.com/threads/right-way-for-performance-divide-scene.1023673/#post-6630961
    https://forum.unity.com/threads/right-way-for-performance-divide-scene.1023673/#post-6754330

    https://forum.unity.com/threads/problem-with-canvas-ui-prefabs.1039075/#post-6726169

    A multi-scene loader thingy:

    https://pastebin.com/Vecczt5Q

    My typical Scene Loader:

    https://gist.github.com/kurtdekker/862da3bc22ee13aff61a7606ece6fdd3

    Other notes on additive scene loading:

    https://forum.unity.com/threads/removing-duplicates-on-load-scene.956568/#post-6233406

    Timing of scene loading:

    https://forum.unity.com/threads/fun...ject-in-the-second-scene.993141/#post-6449718

    Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It's a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

    Two similar examples of checking if everything is ready to go:

    https://forum.unity.com/threads/daily-events-and-content-changes.1108202/#post-7143713

    https://forum.unity.com/threads/uni...on-before-other-scripts.1153739/#post-7401794
     
  3. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I'm trying to figure out the same thing. Is one of the Dots packages required or something to get access to SubScenes?
     
  4. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    1,331
  5. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    1,331
    You can open multiple scenes in the editor simply by dragging-and-dropping scene assets to the Hierarchy window.

    multiple-scenes.gif

    To load multiple scenes in code use
    SceneManager.LoadScene(sceneName, LoadSceneMode.Additive)
    .

    To load multiple scenes in code in edit mode use
    EditorSceneManager.OpenScene(sceneAssetPath, OpenSceneMode.Additive)
    .
     
  6. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I didn't know this. How is this different from ECS SubScenes? And is this applicable or which is preferable for Unity 2020.3 lts ? Thanks for the help
     
  7. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
  8. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    1,331
    Hummy91 likes this.
  9. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    1,331
    Hummy91 likes this.
  10. ThreadLok

    ThreadLok

    Joined:
    Nov 8, 2012
    Posts:
    5
    TLDR... "turn it off and on again"...

    I just whipped up a 2d URP project to test ECS 1.0.10 out and was following things like the spawner example, or codemonkey, and they say just right click on Hierarchy and it will be at bottom of list.

    If you did like me, and just added the entity package to a project it may not be there (2022.2.21f1) after adding the package. I found this thread and none of that was my problem.

    I just closed unity, and reopened - and there it was at bottom of list.
     
  11. jamblefoot

    jamblefoot

    Joined:
    Dec 5, 2016
    Posts:
    1
    I had this issue, and it was because I was using the untitled default scene. It was resolved by first saving the scene, and then right clicking in the hierarchy to make the new subscene.