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

How would you build portals or the Tardis in Unity?

Discussion in 'General Discussion' started by Arowx, Aug 21, 2018.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    How would you go about building rooms, vehicles and sub-worlds in Unity that have 'magical' or Tardis, larger on the inside, like dimensions?

    Let's say you build a fantasy castle and fit all the rooms then realise it would be cool to have magical or hidden/secret rooms and passageways...

    You could re-build your castle model or could you add in portal style rooms and passageways that don't fit into the physical spaces provided but work in game... how would you do this in Unity?
     
    Unknown33 and frosted like this.
  2. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044


    Seems like a pretty good tutorial on the subject, at the very end his implementation does appear pretty smooth.
     
  3. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I thought Unity could handle separate multiple scenes would a multi-scene solution work?
     
  4. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Sure, but the problem is connecting those scenes.

    If you have a fixed model of your map/castle, loading in other scenes by itself won't help add rooms (especially when those rooms won't physically fit). You need to smoothly teleport the player from one location to another, and like you say in the title, "portals" are probably the best ways to do this.

    You could, load in your "secret room" as a secondary scene, but you still need to fit it into the environment and let the player move between rooms.
     
  5. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    I would use coding and algorithms.
     
    ikazrima, xVergilx, Unknown33 and 4 others like this.
  6. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    So you can't portal scenes within scenes?
     
  7. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    I'm a swearing and hacks man myself.
     
    xVergilx, Unknown33 and Ryiah like this.
  8. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    The trick is having two rooms appear to take the same physical location, and that's where you need some trickery (portals). What objects exist in what scene doesn't really matter so much.

    Let's say you wanna make a tiny little castle that appears 5x5 on the outside but 100x100 on the inside. You fake the 'doorway' (portal), and make passing through the doorway secretly teleport you to the interior.

    It doesn't matter if the castle exterior and interior are in different scenes or not. It just matters that you place the interior at a different position, then use some trickery (portals) to teleport smoothly between the two locations
     
    Unknown33 likes this.
  9. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,355
    You'd just have to load both scenes at the same time, so then it would really be just the same as that video that frosted posted.
     
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Stencil buffee portals are probably hard to beat performance wise
     
  11. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Code (CSharp):
    1. transform.position = someWhereElse;
     
    Unknown33 and Joe-Censored like this.
  12. Unknown33

    Unknown33

    Joined:
    Aug 18, 2018
    Posts:
    170
    :cool:
     
  13. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    That does not solve the camera problem of looking into the Tardis?
     
  14. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Corners. Sometimes the old ticks are the best ones.
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,128
  16. IgnisIncendio

    IgnisIncendio

    Joined:
    Aug 16, 2017
    Posts:
    223
    The video at the beginning of the thread solves the issue using a render texture, a seperate camera for the portal and a script.
     
  17. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
  18. Braineeee

    Braineeee

    Joined:
    Nov 9, 2014
    Posts:
    1,211
    What are you smoking??