#Cant drag text into my Score text script
1 messages · Page 1 of 1 (latest)
In case you are using tmpro for the text
i dont get it where does it say ''using TMPro?
where does it say ''SOMETEXT'' and where do i set text?
It sounds like you are trying to drag a Unity UI Text component into a variable in a script, but it's not working as expected. The reason for the red circle is that the variable in the script is likely not of the correct type to accept a Unity UI Text component.
You can check the variable type in the script and make sure it is of the correct type to accept a Unity UI Text component. If it's not, you can change the variable type in the script to match the type of the Unity UI Text component.
Another possibility is that the script is not on the same GameObject as the Unity UI Text component, you need to make sure that the script component is on the same GameObject as the Text component, or you can use GetComponent<>() function to get the text component.
Finally, you can try to reimport your Unity UI package if the problem persists, as it may be a problem with the import.
Please let me know if you have any other question or if this solution did not work for you.
-ChatGPT
how do i match the vaiable type? is it suppose to be the exakt same name as what is says outsite the script? its called TextMeshPro - Text (UI). am i suppose to write that in the script? right now i have written ''public Text scoreText;''
No, Text is the class for the normal Unity UI text (UnityEngine.UI.Text), which is not interchangeable with the TextMeshPro type. What you need to use is TextMeshProUGUI (make sure to include the TMPro namespace in order to access this type or any type related to Text Mesh Pro).
where and how do i include the TMPro?