• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Dec 28, 2018 at 07:16 PM by umadgen_unity for the following reason:

The question is answered, right answer was accepted

avatar image
Question by umadgen_unity · Dec 28, 2018 at 05:44 PM · scene-loadingscene-switchingload scene

LoadScene.Single don't close the current scene

Hello everybody ! I 'm a beginner in unity, and i try to create a menu to switch between scenes. But when i switch, i can see in the background the last scene.

The background camera is a solid color in all scenes. I don't understand why because i use LoadScene.Single to close all others scenes. Before the switch : alt text After the switch : alt text Can anybody help me to find a solution please ? Thank's.

beforeswitch.png (88.0 kB)
aftersiwtch.png (261.3 kB)
Comment

People who like this

0 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 3kWikiGames · Dec 28, 2018 at 05:54 PM 0
Share

Is this a different scene or is it a different ui element? Could we see a screenshot of your Hierarchy to see if its somehow being carried over into the next scene.

avatar image umadgen_unity 3kWikiGames · Dec 28, 2018 at 06:01 PM 0
Share

It's a new scene. This is the hierarchy for the first scene. alt text This is the hierarchy for the second scene. alt text

The gameobject that i don't show are just container for input field and label. I use a gameobject tabmenu to display menu on all scenes.

sceneclient.png (15.8 kB)
sceneprojet.png (13.4 kB)

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by umadgen_unity · Dec 28, 2018 at 07:16 PM

Solution found : I had a singleton attached to each main gameObject. I write DontDestroyOnLoad on the function Awake on my singleton. So i remove the singleton on each gameobject, and i put a gameobject with my singleton.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

100 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Loading screen with long-running CPU-heavy Awake() 1 Answer

How to prevent a script from running until the scene is loaded? 2 Answers

Canvas will only appear on the game screen when its child of a new loaded scene canvas 1 Answer

Display a GameOver scene then restart the game 1 Answer

Particular scene loads fine in the Unity Editor, but unable to load in the executable? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges