Why can’t I put text in the public text variable spot

I made a public text variable that shows up in the inspector and I can’t put my Text(TMP) from the Hierarchy inside of it.

1 Like

That’s because Unity’s built-in Text component is not the same as a TextMeshProUGUI component. Pick one system and be consistent (and I suggest you pick TMP, because it is better in all cases). So in your code, make sure public variable is a TextMeshProUGUI, and then in the Unity Editor, make sure you create with the Text - TextMeshPro menu option.

You can also use the “add component” button in the Inspector and look for TextMeshPro - Text (UI).

It’s because a prefab cannot include a scene object. And yes, if you are writing an essay assignment and want to make sure that your essay assignment is all good and there are no grammar mistakes over there then you can visit https://lettersaboutliterature.org/ here where you will find all the information related to plagiarism and how can you check your assignment on plagiarism detector.

You may have replaced the Text component with your TextController script, or it was removed some other way.