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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[How to handle it?] Top-down world with multiple floors

Discussion in '2D' started by Ivanskodje, Apr 9, 2015.

  1. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Greetings!

    I am looking around for different solutions in solving a challenge that is ahead of me.

    I am looking for a way to handle multiple floors in a top-down 2D world environment, but I am a little short on ideas how to do that. I am not looking for a complete script or anything like that - just looking for a tip or two :)

    The idea I am kinda working towards (without consulting the forum) is to use the "Layers" (not sorting layers) and somehow specify that "Floor 1" Layer and "Floor 2" Layer are exclusive. Which means everything on "Floor 1" layer will be unable to interact with anything on "Floor 2" - but I am not sure if this is a good way of handling it.

    Another idea was to create separate buildings with its own triggers - so that when I enter it, it will instantiate the "building" and its floors for that player, and use triggers to change the player and cameras Z position when going up or down.
    Again; I am not sure if this would be a good way of handling it.

    Any and all suggestions in how to handle this challenge will be much appreciated!

    In case you are curious; this is the project I am working on.
     
  2. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    I have solved the problem - or at least I have made a functional script and separated each floor with layers.
    I wrote a somewhat detailed description of how I did it in this [post] - in case someone have the same problem as I had in the future. I have yet to refine it though - but it works.