Search Unity

Level

Discussion in 'Editor & General Support' started by Lightme, Dec 20, 2017.

  1. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    Hello,

    I just started learning Unity, and I have I think a basic question that is:

    How does level works in Unity, like I am a player I win the level and I want to go to the next level?

    In Unity how do I make this next level and how do I tell the engine that I move on?

    Probally awnsered before but it's so much topics that I cannot find the right topic...

    Thank you and Hi to you all!
     
  2. BrewNCode

    BrewNCode

    Joined:
    Feb 17, 2017
    Posts:
    372
    This is simple. You have to make every scene 1 level. while finishing the level, Unity has to change the scene to get to the another level. For this, you focus noe on level design, UI, and Programming.

    So, Scene1 = level 1 - Scene 2 = Level 2, and so on.
     
    Lightme likes this.
  3. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    hey Dreaddisk,

    Thank for your awnser.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There's several ways you can do it. The most direct approach would be what was already mentioned, have a different scene for each level, and at the end of a level you switch to the scene for the next level.

    Depending on what a level really is in your game though, you could really take a variety of approaches.

    * Levels could just be separate areas of the same scene that either directly connect with each other, or don't connect and you just teleport the player to the next area within the scene corresponding to the next level
    * You could instantiate your terrains and other level specific objects from prefabs and just reload the same scene to advance to the next level, or just destroy all the old level stuff and instantiate the new level stuff, probably with some type of fade out transition while this occurs
    * You could make moving from one level to the next rather seamless while keeping them as separate scenes by using additive scenes instead of hard switching scenes
    * Similar to the first one, you could make your levels all in the same scene and stack them vertically instead of horizontally, so your next level is physically located in the scene above the player where you will teleport them when completing this level, but the player cannot see it either due to disabling layers on the camera, or placing the next level further away than your camera's max clipping plane distance
     
    theANMATOR2b and Lightme like this.
  5. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    Hello Joe-Censured,

    Thank you for the in-depth level explination. Like for example it depands what a level means. Take for example the Roll-A-Ball game tutorial, what if I want to make after the "player" has collected all 12 "pick-ups" he want to advance to a new level, than I should make a new scence right? But if a level of a "player" like in a RPG than it is a whole other level of explaining (nice word playing). Am I seeing this correct?
     
  6. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    There is no build in level progression tool. You have to build it yourself.

    Another dimension to this is how the levels are build and stored
    - layed out in the editor and saved as a scene, prefab, etc...
    - layed out in a serialized form and rebuild at runtime
    - procedurally generated at runtime

    I am not familiar with the roll a ball tutorial, but from the sound of it you could either
    - switch to a new scene, where the pickups are layed out as level 2
    - you could load / generate level 2 positions and instantiate the pickups into the existing scene


    There is no one answer...