Android BUG? SetText() is not the same as setting .text

The following seems to apply to Android (specifically Oculus Quest) builds and Unity 2019.3.0f5 with TextMesh Pro 2.0.1

When attempting to set the text of a TextMeshProUGUI component using the SetText() method, visually it looks OK but the value read at some later stage still contains the original value.

Setting .text works as expected.

SetText() goes through a different path and only updates / keeps in sync the .text property in the Editor. This is to avoid allocations.

SetText() should only be used with short strings and to combine / format the text with variables.

I also modified the behavior of plain SetText() in 2.1.0-preview.3. By plain SetText() I mean the variant when only using a string. This would should sync at runtime.

2 Likes

Thanks; perhaps some clarification in the documentation could save some future time… not that I saw any reference in here to that method.

g.