I am new to unity and im trying to make a score-counter for my game. So I made a Text object in: GameObject < UI < Text. Which I then "put" in my script.
The code is as following :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Example : MonoBehaviour {
public Text helloText = new Text();
void Start () {
helloText.text = "Hello";
}
}
I now tried to initialize the variable as one of the users said but im now getting this following error:
UnityEngine.UI.Text.Text()' is inaccessible due to its protection level