Search Unity

LoadScene in background but don't start it immediately

Discussion in 'Scripting' started by sebwin555, Sep 16, 2018.

  1. sebwin555

    sebwin555

    Joined:
    Sep 9, 2018
    Posts:
    22
    Hey guys!

    So I have a menu scene and while it is showing I want to load the game scene, because it takes a little longer to load. The issue is that I don't want to switch to the scene immeditaley, but wait until the user pressee the play button!

    Is there a way that's really working? Because I tried some things, but those didn't work in my case..

    Thanks in advance!
     
    hopetolive likes this.
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
  3. hariprathaap

    hariprathaap

    Joined:
    Aug 22, 2017
    Posts:
    2
    Is it possible to load all the scenes before the start of the game? I tried loading but only the first scene gets loaded not the rest. @tonemcbride
     
  4. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    With the (fairly) new SceneManager there's various ways to achieve what you want. You could load all the scenes additively and then activate or deactivate them when you want. There's a good tutorial on that here: https://unity3d.college/2016/09/26/scenemanager/