- Home /
import SceneMangement not working?
I
- switched from Application.LoadLevel to SceneManager.LoadScene because Unity said it was obsolete.
- Added using UnityEngine.SceneManagment;
- Changed using to import.
- Placed the code in different spots since I am unsure where this line is actually supposed to go.
Here's a picture of what I currently have (keep in mind, while it says using I did try import already). The blue lines indicate the other places that I tried placing the code with no luck.
I'm sure it's a simple fix, but I am a complete nooob & have only the slightest idea of what I'm doing lol. Thanks in advance for any help.
Answer by doublemax · Oct 18, 2016 at 04:31 PM
As you're using JS, you need "import", not "using". And it should be at the top of the file.
From the documentation:
#pragma strict
import UnityEngine.SceneManagement;
public class ExampleClass extends MonoBehaviour {
function Start() {
// Only specifying the sceneName or sceneBuildIndex will load the scene with the Single mode
SceneManager.LoadScene("OtherSceneName");
}
}
Your answer
Follow this Question
Related Questions
Unity error 2 Answers
Problems Importing Scene 1 Answer
what is the scene management algorithm may be used in Unity? 1 Answer
Vuforia imported. Too many errors. 0 Answers
completely lost noob 1 Answer