Cant Drag Damage Text

Hello All.

At 2:54 in the video Sam drags his Text (it’s the Damage Text element), into the newly created Damage Text prefab spot on the Damage Text Script element we have.
image

I’m using TextMesh Pro and I can’t drag the text into that field.
image

Should I be doing something else in this case? Or should I add this function through code now because of TextMesh Pro? Sam doesn’t go over a TextMesh Pro solution.

Thank you so much for the help everyone. :smiley:

Hi Tooncis,

The type of the variable must match the type of the component. Text is not the same as TextMeshProUGUI. If you want to use the TMP component in your code, replace Text with TextMeshProUGUI and add the TMPro namespace at the top of your script.


See also:

1 Like

Yup. I forgot to do this again. I don’t have the option to add just text, unless I go to “Legacy” and I don’t want to do that. I want to use what is current. Thank you so much.

From the DamageText.cs script for TextMesh Pro update

Then that changes your Damage Text prefab spot on the Damage Script element in the Inspector to show this.
image

Then drag and drop your Text element and you are back on track. :smiley:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms