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 are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

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.
unityunity