Question by
MakeGames2020 · Mar 19, 2016 at 03:13 AM ·
load levelsemicolon
Error with 6 line of code
I have no idea whats wrong here I have only 6 lines of code and im getting this error. This is the error: Assets/Scripts/Collisions.js(1,6): UCE0001: ';' expected. Insert a semicolon at the end.
using UnityEngine.SceneManagement;
function OnCollisionEnter()
{
SceneManager.LoadScene(SceneManager.GetActiveScene);
}
Comment
Best Answer
Answer by Zoogyburger · Mar 19, 2016 at 03:13 AM
In Javascript, use
import UnityEngine.SceneManagement;
instead of
using UnityEngine.SceneManagement
Yup that did it there must be an error on this page: http://docs.unity3d.com/ScriptReference/Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene.html
At the bottom it says
Note: In JavaScript add: using UnityEngine.Scene$$anonymous$$anagement;
$$anonymous$$inda annoying thanks for the help :)