![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);
}
}
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.