I have autotextsize on, but when I look at .fontsize, it just gives me 36 every time, even though the editor clearly shows that it’s 15.45 (but greyed out).
How can I get the current autoscaled font size when using textmeshpro?
I have autotextsize on, but when I look at .fontsize, it just gives me 36 every time, even though the editor clearly shows that it’s 15.45 (but greyed out).
How can I get the current autoscaled font size when using textmeshpro?
What version of the TMP package are you using?
Checking the fontSize property should return the optimum point size. Now, if you check this property before the text object has been processed / rendered, the fontSize will be whatever the default was. If you need to check this fontSize property to do some stuff in code, then you can use TMP_Text.ForceMeshUpdate() to force the text object to be processed / rendered before you check this value.
P.S. The following post might also prove useful to you.