Hi everyone i have a script which for some reason doesn’t work. Unity says that there is a parsing error could anyone help me out?
This is my script :
using System.Collections;
public class MenuObject: MonoBehaviour {
// Use this for initialization
void OnMouseEnter () {
renderer.material.color = Color.blue;
}
void OnMouseExit () {
renderer.material.color = Color.white;
}
public AudioClip click; // set this variable in the Inspector
void OnMouseDown () {
audio.PlayOneShot(Click);
Application.LoadLevel("LevelSelectScene");
}
- Missing a closing bracket for the class
- ‘click’ should be lower case on line 19
- Missing ‘using UnityEngine’ (may be past issue)
using UnityEngine;
using System.Collections;
public class MenuObject: MonoBehaviour {
// Use this for initialization
void OnMouseEnter () {
renderer.material.color = Color.blue;
}
void OnMouseExit () {
renderer.material.color = Color.white;
}
public AudioClip click; // set this variable in the Inspector
void OnMouseDown () {
audio.PlayOneShot(click);
Application.LoadLevel("LevelSelectScene");
}
}
Note is far easier to get help if you 1) format you code when posting by selecting the code and using the 101/010 button, and 2) you past in the error text from the console window.