So I have a panel and to that panel iv’e attached a script that does basically this:
public Text myTextField;
Than in the inspector I dragged the Text element
Than in the update function I just do this:
myTextField.text = "tralalalala";
for some reason the console is giving me a NullReferenceException: Object reference not set to an instance of an object error
The thing is the text element is set in the inspector and its actually working as in the text changes to “tralalala”
Any ideas why the error?