Question by
Yay_For_Humzah · Nov 06, 2016 at 12:15 AM ·
errorpublicpublic variablepublic static
CS0103 and CS0246 with "public Text text;"
So when I define anything in public, for reference (LevelManager, Text) it makes it red and gives me error CS0246 and CS0103 as errors. Also, when I connect it to my object, the public doesn't give me a place to drag the thing I want to onto it. I'm new to Unity, and I have gone through the Q.A., but I can't find anything. HELP!!! Code:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class LoseColliderScript : MonoBehaviour {
public LevelManager levelManager;
void OnTriggerEnter2D (Collider2D trigger) {
levelManager.LoadLevel("Win");
}
}
The main thing is that when I comment out the "public" line, everything works.
Comment