Search Unity

Question Build problem

Discussion in 'Getting Started' started by bratan20000, Nov 27, 2021.

  1. bratan20000

    bratan20000

    Joined:
    Oct 28, 2021
    Posts:
    12
    In my game for android I have button that loads new scene additively and previous unloads.Also, I have Buffer scene that must be always loads.
    So I have 2 problems:
    1.When I start game Buffer scene disappear.
    2.When I press the button previous scene doesn't unload.
    In the unity editor i don't have this problems.But when build they appear.
    How I am load and unload scenes:
    Code (CSharp):
    1.     private void LoadTradeScene()
    2.     {
    3.         SceneManager.UnloadSceneAsync((int)Scenes.MAIN);
    4.         SceneManager.LoadSceneAsync((int)Scenes.TRADE, LoadSceneMode.Additive);
    5.     }
     
  2. bratan20000

    bratan20000

    Joined:
    Oct 28, 2021
    Posts:
    12
    Solved!
    Just load second Scene in the Awake() method. Unity can't loads 2 scenes at once at first start in building version, while unity editor can.
     
    Joe-Censored likes this.