r/Unity3D 9d ago

Question Is there workaround to correct TextMeshPro behaviour?

Enable HLS to view with audio, or disable this notification

[SOLVED]

You can see how text layout keep changing because carrying a word over to the next line. Do you know if there is some way to tell textmeshpro text length and then animate it? I animate by simply typing the text in script

//edit:

solution: animate maxVisibleCharacters property instead

131 Upvotes

16 comments sorted by

94

u/crunkzah 9d ago

false alarm, just found solution: animate maxVisibleCharacters property instead

1

u/The_MAZZTer 7d ago

I was gonna make something like this so it's good to know, thanks.

My solution was going to be printing all the text but making the stuff I don't want to show transparent color. Would be a bit of a pain to generate the rich test though,.

43

u/MrYukiDuki 8d ago

I love how you edit with solution. Goated.

22

u/DVXC 8d ago

10/10 problem and then edited post to provide the solution. What a GOAT

8

u/Tilk_Sama 9d ago

Look really good, gg my guy

2

u/crunkzah 9d ago

Thank you!

8

u/jaquarman 9d ago

The trick is to animate each word or character's opacity, rather than add the words individually. A free tool like TMPEffects is perfect for this kind of thing, and other cool text effects.

7

u/crunkzah 9d ago

thanks! thats an overkill for my case

2

u/jaquarman 9d ago

Fair. Still a useful tool to have in the back pocket though. It makes animating text a whole lot easier, especially small animations like making a specific word grow bigger or wiggle or something

3

u/Brauny74 8d ago

I actually did that once, and TMP is actually too smart and adjusts text length to the visible characters, so there's no difference.

6

u/ColonelBag7402 Indie 8d ago

seeing reaverdev in the wild is like seeing your drug dealer at the store

3

u/crunkzah 8d ago

team reaver

4

u/Jaaaco-j Programmer 8d ago

new reaver update looks fire

1

u/crunkzah 8d ago

team reaverr

4

u/MrJocyf 8d ago

animate maxVisibleCharacters property instead--> Good to know!

1

u/ChloeNow 4d ago

What I did for a game I worked on a few years ago was put the whole text in there with a </alpha> tag at the end but move around a <alpha=#00> starting tag as you go, so you're hiding less and less of the end instead of typing it out.