Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by Vking23 · Jul 19, 2016 at 10:04 PM · scripting problemscenesswitchingswitch scenes

Scene Switching problem. Scene becomes black when it changes

![alt text][1]I am making a game and when I try to have the game switch to the scenes the whole next scene is completely black. I can still see the outlines and my scripts work fine. This usually happens when I move scenes for the third time. If I go to edit the scene that turns black it is normal and plays normally. Can someone help me, please. My scripts and scene are posted My scene changing script is

using UnityEngine; using System.Collections;

public class MoveScene : MonoBehaviour {

public void ChangeToScene (string sceneToChangeTo) { Application.LoadLevel(sceneToChangeTo); } }

bandicam-2016-07-19-15-00-38-404.png (73.0 kB)
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by TBruce · Jul 19, 2016 at 11:28 PM

First Solve all your errors (Look at your error list).

Next, Application.LoadLevel is deprecated (Also in your error list). Instead use SceneManager.LoadScene(). See examples below

 import UnityEngine.SceneManagement; // place this after #pragma line
 SceneManager.LoadScene(nextLevel);

or

 import UnityEngine.SceneManagement; // place this after #pragma line
 if (SceneManager.GetActiveScene().buildIndex < (SceneManager.sceneCountInBuildSettings - 1))
 {
     SceneManager.LoadScene((SceneManager.GetActiveScene().buildIndex + 1);
 }
 else
 {
     // reload current scene
     SceneManager.LoadScene((SceneManager.GetActiveScene().buildIndex);
 }

Note: It is VERY important that all scenes are listed in the "Scenes In Build" list on the "Build Settings" screen.

Comment
Add comment · Show 3 · 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
avatar image Vking23 · Jul 20, 2016 at 12:25 AM 0
Share

Sorry I had the wrong picture of my script

avatar image TBruce Vking23 · Jul 20, 2016 at 12:33 AM 0
Share

And I forgot to mention this, from the main menu go to "Window\Lighting" and a window will pop up. There will be three tabs. It does not matter which tab you go to but to make explaining this easier select the last tab ("Lightmaps"). You will see a checkbox labeled "Auto". $$anonymous$$ake sure that it is unchecked an press the "Build" button right next to it.

avatar image Vking23 TBruce · Jul 20, 2016 at 12:42 AM 0
Share

The lightmaps worked just fine. I didn't need the scripts

avatar image
0

Answer by husseincheayto · Nov 02, 2018 at 09:56 AM

have found a way to remove the black screen when switching between scenes in this link: https://youtu.be/lgby922jooA

Comment
Add comment · 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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

74 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

Related Questions

Complicated level change problem 1 Answer

switch through switch cases forward and backward with pressing two buttons 0 Answers

Unity 2D Store on Different Scene? 0 Answers

Switching items - can't detect a crazy loop that is happening. 1 Answer

Problem with script in multiple scenes needing to refer to FPS Controller. 1 Answer


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