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

How to delete or deactivate a scene from BuildSettings with codes?

Discussion in 'Scripting' started by generalzaza, Apr 9, 2021.

  1. generalzaza

    generalzaza

    Joined:
    Dec 27, 2020
    Posts:
    3
    I have one scene that I don't want to use after scene once loaded. How can I do that ,and is there any posibilities I can. Thank you for your answer.
     
  2. jasonasaad2

    jasonasaad2

    Joined:
    Nov 30, 2020
    Posts:
    51
    You don't need to do that, that scene is not active when a different one is loaded, so load the scene you want, and then leave them all in the build settings.
     
    generalzaza and Joe-Censored like this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Only when you call LoadScene and specify to load in additive mode does it keep the current scene loaded. Otherwise it automatically unloads the current scene when it switches to the new one. To not use the old scene again, just don't load it again.
     
    generalzaza likes this.
  4. generalzaza

    generalzaza

    Joined:
    Dec 27, 2020
    Posts:
    3
    Thank you for your answers.
     
    jasonasaad2 likes this.