- Home /
Question by
Markram1995 · Sep 22, 2014 at 01:22 PM ·
error-message
Assets/mouseover.cs(6,21): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
I can`t figure out what`s wrong any help would be appreciated.. Thanks in advance !!
using UnityEngine;
using System.Collections;
public class mouseover : MonoBehaviour
{
var showGUI : boolean = false;
void onMouseOver () {
showGUI = true;
}
void onMouseExit () {
showGUI = false;
}
void onGUI () {
if(showGUI)
GUI.Label (Rect (10,10,100,20), "Chop down Tree");
}
}
Comment
Answer by robertbu · Sep 22, 2014 at 01:23 PM
Line 6 is in Javascript, not C#. It should be:
bool showGUI = false;
And you are missing a 'new' (required for C# but not for Javascript) on line 19:
GUI.Label(new Rect(10,10,100,20), "Chop down Tree");
Your answer