Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Same static object in multiple scenes, how to organise

Discussion in 'Editor & General Support' started by JDMTourer, Aug 1, 2023.

  1. JDMTourer

    JDMTourer

    Joined:
    May 28, 2023
    Posts:
    4
    Good afternoon Unity gurus. I don't know which forum thread should post this.
    I ask for a minute of your attention (and maybe more :)) and help in understanding how to organize it correctly.
    There is a static object - a house in the scene. It is the main object where the player is located.
    Each level of the game is a changing environment around the house. The house is in fact static in every level, and changes only the exterior around the house.
    Tell me, a beginner, how best to organize this in order to do it more optimally?

    At the moment, the prototype is divided into 10 scenes, each of which represents a level. Use only the prefab of the house object, which is inserted into each level? So that at least changing something in the prefab would automatically change all the scenes.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    This seems like a good use of additively loaded scenes. The house is it's own scene, and the various different surroundings their own scenes too. You just need to unload and load the various surrounding scenes on top of the house scene.

    Plenty of tutorials out there on how to use additively loaded scenes.
     
    JDMTourer and Kurt-Dekker like this.
  3. JDMTourer

    JDMTourer

    Joined:
    May 28, 2023
    Posts:
    4
    Wow, great! How can i forgot about this feature. Thank you for your advice! I'll try.
     
    spiney199 likes this.
  4. JDMTourer

    JDMTourer

    Joined:
    May 28, 2023
    Posts:
    4
    I found a very good guide from one website. So if someone found this thread, you can use this tutorial, very good explanation.
     

    Attached Files:

    Last edited: Aug 2, 2023
  5. JDMTourer

    JDMTourer

    Joined:
    May 28, 2023
    Posts:
    4
    Did as you suggested - works great! Thanks again for the advice.
     
    Kurt-Dekker likes this.
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Additive scenes are indeed awesome. Here's a few more of my own notes:

    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
     
    JDMTourer likes this.