Search Unity

Having a character go through a door that leads to a new environment

Discussion in 'World Building' started by MonkeyPuzzle, Jul 12, 2019.

  1. MonkeyPuzzle

    MonkeyPuzzle

    Joined:
    Jan 17, 2016
    Posts:
    119
    Pretty much explained in the title. I want to have one of my characters go through a door, say perhaps entering into a house, but walk into an entirely different scene. Imagine if you walked up to a house, walked through the door and entered into a green field outdoors, that kind of thing.

    Any thoughts on how I might accomplish such a thing?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Put a trigger in the doorway, attached to a script that calls SceneManager.LoadScene.
     
  3. Phoenix116

    Phoenix116

    Joined:
    Jun 30, 2016
    Posts:
    39
    I think you are searching for something like this


    If it doesn't adapt to your needs, I would suggest you to search "unity portals" in youtube :)
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    A portal is much more complicated than what it sounds to me like the OP was asking for. Most games simply have a dark/opaque/closed door, and when you activate it, they fade to black, load the next scene, and fade back in.