Search code examples
javascriptsceneunity-game-engine

How do I change scenes with JavaScript on click? (Unity5)


I just want to know how to change to a different scene in Javascript when I click the mouse. 'Application.LoadLevel' is apparently now obsolete. Please as simple a script as possible because I really can't grasp the advanced stuff and they usually end up with some sort of error that I'll have to ask about.


Solution

  • The docs cover this quite well.

    http://docs.unity3d.com/ScriptReference/Application.LoadLevel.html

    Use SceneManager.LoadScene