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

Change what scene the game launches in based on variable?

Discussion in 'Editor & General Support' started by Kristen182, Jul 26, 2019.

  1. Kristen182

    Kristen182

    Joined:
    Aug 10, 2018
    Posts:
    42
    I'm not sure if this is possible but I thought I'd ask here. Basically, I want to be able to launch a different scene when the game opens if the player has never played before. I'm not sure that this is possible because player prefs wouldn't be loaded until a scene launches, and the initial scene is based on build settings. I am currently building for Android if that matters. Can anyone think of a way to change the scene the game launches in based on a variable?
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,907
    Solution: build a very small scene, the only purpose of this is to load all the things ahead of time and decide which other scene to load. Basically a loader-scene. The platform does not matter, just make sure this "empty" scene is the very first in the build settings.
     
    Joe-Censored likes this.
  3. Kristen182

    Kristen182

    Joined:
    Aug 10, 2018
    Posts:
    42
    That worked great, thank you very much!