Search Unity

Scenes are staying behind..

Discussion in 'Editor & General Support' started by Josh_DevDev, Dec 20, 2019.

  1. Josh_DevDev

    Josh_DevDev

    Joined:
    Dec 20, 2019
    Posts:
    5
    I'm not quote sure how to explain this to be honest. Whenever I load a new scene, it keeps the previous scene active. For example, here is the main menu:
    upload_2019-12-20_16-34-1.png

    When I click 'Play Game', it loads a new scene called 'Gamemode', which contains each level. It's meant to look like this:
    upload_2019-12-20_16-34-38.png

    but instead looks like this:
    upload_2019-12-20_16-34-52.png

    Strangely, this only happens in the built version of the game, not in the engine itself. I'm sorry if I'm not explaining this properly, but I am not quite sure what is going on..
     
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,317
    What are you doing to load the scenes?
     
  3. doarp

    doarp

    Joined:
    Sep 24, 2019
    Posts:
    147
    Either the old scene uses DontDestroyOnLoad or the new scene is loaded with Additive mode.
     
  4. Josh_DevDev

    Josh_DevDev

    Joined:
    Dec 20, 2019
    Posts:
    5
    Code (CSharp):
    1. public void Levels()
    2.     {
    3.         SceneManager.LoadScene(levelGameScene);
    4.     }
    Strangely, it's only this one scene that breaks.

    It only does it in the built version of the game, so wouldn't this glitch be in the editor too?
     
  5. Josh_DevDev

    Josh_DevDev

    Joined:
    Dec 20, 2019
    Posts:
    5
    Update: it copies everything. Even the development console gets transferred over which makes me feel like it isn't anything in code?
     
  6. Josh_DevDev

    Josh_DevDev

    Joined:
    Dec 20, 2019
    Posts:
    5
    Turns out it was LWRP that caused the problem. Interesting.
     
  7. doarp

    doarp

    Joined:
    Sep 24, 2019
    Posts:
    147
    That makes no sense. Something is missing.
     
  8. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,317
    Are the gameobjects themselves getting transferred over, or just their images?
     
  9. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I was wondering if there's an issue with the camera settings. Such as with camera.clearFlags.
     
  10. Josh_DevDev

    Josh_DevDev

    Joined:
    Dec 20, 2019
    Posts:
    5
    just the images
     
  11. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,317
    Check the Clear Flags on the camera of the second scene. It should be set to skybox or background color.