I’m trying to use rich text, following the documentation exactly but it seems there is a bug (using 2018.3.0f2) where it replaces the greater than character from my markup tags with a less than character. For example if I type:string boldTxt = "<b>I want this text bold</b>"; then unity prints <b<I want this text bold</b<
Is there a workaround for this?
edit: Rich text works if I type the tags into the the inspector but I’m trying to use a script
So I made a fresh script and UI text element just to make sure there was nothing else effecting it and low and behold the code I posted is working from that script something was effecting it. The tag.
An appended color tag with spaces. <color = green> should be <color=green>. Taking out the spaces fixed it. But here’s where it gets weirder. I can’t recreate the flipping around of the greater than sign on the new script. If I leave spaces it simply prints out the as is. So I never did figure out what’s flipping the greater than character into a less than. So weird… But I’m accepting this as a mystery and moving on since taking out the spaces from the color tag worked.
Glad you could solve it, though those things are a nightmare because you never know when it it come again to haunt you
I would suggest you try out TextMeshPro since it is part of Unity and gives much clearer text and a ton of options. For example I used it to make links in the text that show info boxes when hovering over it.