Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Scenes within scene - best practices?

Discussion in 'General Discussion' started by Deleted User, Dec 2, 2018.

  1. Deleted User

    Deleted User

    Guest

    Hi, following setup:

    I have a virtual living room with multiple "screens" (i.e: Computer, TV), in each of them is a minigame.

    I would like to realize each minigame as separate scene, and then show these scenes inside the living room-mainscene on the various screens. All scenes should be run and shown simultaneously (i.e: You play the TV-minigame, while the computer-minigame and the living room itself are visible and also "running").

    Question:

    I guess I need a "scene in scene" mechanism. What's the best course of action for that? Is there something like a "window"-widget for scenes in Unity for such a scenario?
     
  2. If these mini games are 2D, you can restrict their positions and sizes to the screens. However if you're developing full-fledged 3D games within your scene, probably you will need to create three rendertextures with three cameras and render them onto the screens. But this is extremely inefficient and resource-hungry solution.
     
  3. Deleted User

    Deleted User

    Guest

    Yes, they are 2D.

    "you can restrict their positions and sizes to the screens."

    How to do that? I get the principle, but I've never done a scene-in-scene approach before. Do you drag and drop scenes into the mainscene to achieve that (merge?)

    Or do you have to render them on a surface in the mainscene? And if so, how?

    And what are the performance considerations for each approach?
     
  4. Does not matter if they're in multiple scenes or not, you can put them to a boundary game object which can be positioned exactly to the screen. And voila!

    Nope, you don't drag and drop. You create the scenes, if you have a stable global coordinate system (which means the screens are always at the same coordinates) just position everything relative to them and load these scenes additive.
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    https://docs.unity3d.com/Manual/HOWTO-UIWorldSpace.html