Getting Error CS1061

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 ();
    }
}

countText.Text should be

countText.text with the lower case. Caps are important. That might be enough to fix the error.

Though it seems to think you are declaring a texture and trying to access the text part of it…hmm…

1 Like

Thank you so much, cant believe it was such a small problem. Its working perfectly now.
Thanks Again

1 Like

Good to know it’s fixed!