So i started using unity a few days ago and was following a tutorial and when i had to create a UI Text it came up with an error stating i was missing an assembly reference. Any ideas??
I am also using Unity 2017.1.0f3 if it makes any difference
Error:
Assets/Scripts/PlayerController.cs(42,13): error CS1061: Type UnityEngine.Texture' does not contain a definition for
Text’ and no extension method Text' of type
UnityEngine.Texture’ could be found. Are you missing an assembly reference?
My Code:
..
using UnityEngine.UI;
...
public Text countText;
..
private int count;
void Start ()
{
...
count = 0;
SetCountText ();
}
....
//Collision (destroy object tag)
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ("Pick Up"))
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText ();
}
}
void SetCountText ()
{
countText.Text = "Count: " + count.ToString ();
}
}