This is just a guess, but do you have
using UnityEngine.UI;
At the top of your script? I know when I use Text elements I need that there, but I'm not sure you would need it for a GetComponent.
↧