TextMeshPro question

Hi everyone!

I was revisiting this section in order to better familiarize myself with the process (It also doesn’t hurt that I potentially have a paying gig to program a COYA game!) and make sure I can do it all.

So my question, perhaps someone else has asked it before but I am just blind and can’t find it, is how to I tell the Text Mesh Pro section to update like we were telling the text section to update? I can create the game logic and link a TextMeshProUGUI to it, (see the screenshot)

But now when I go into the public class for the adventure game, I can’t seem to add any text to the story. I know I need to reference the TextMeshProUGUI section, and edit the Text Input Box to change to what I tell it to. Problem is, I can’t figure out how to reference specifically that section.

Anyone have any ideas?
/Jeff

Well, figures the moment I post the question, I seem to have solved it. I just did:

variableName.text = (“String”);

and that seemed to make it work.
Thanks though!
/Jeff

Hey Jeff, well done for resolving this yourself.

TextMeshPro exposes the text property as you’ve seen just like Unity’s regular UI Text object. Note, you don’t need those brackets around the string value,just the quotation marks.

Thanks for replying!

I am just used to the brackets. I read the replay a while back about using brackets and the whole debug.log() situation.

Anyway, thanks again!
/Jeff

1 Like

You’re welcome and hehe, no worries :slight_smile:

Privacy & Terms