- Home /
Question by
ReflexGames · Apr 12, 2016 at 03:35 AM ·
semicolon
UCE001 ';' expected, Insert a semicolan at the end Even though I already have one
Here is my script, i still can't get the hit detection to work, and now I am having this problem.
using UnityEngine.SceneManager;
function OnTriggerEnter (col : Collider) {
Debug.Log(col.gameObject.name);
if(col.gameObject.name == "Key");
{
SceneManager.LoadScene(0);
}
}
Comment
Best Answer
Answer by Zoogyburger · Apr 12, 2016 at 03:53 AM
In java script use:
import UnityEngine.SceneManagement;
Instead of
using UnityEngine.SceneManager;
Answer by aditya · Apr 12, 2016 at 05:04 AM
Plus your IF statement is also having a semicolon at the end