This is driving me crazy:
If you copy+paste TMPro txt “A” to “B” (values), multiple bugs happen:
-
“B” will not show, even though it has the identical tag as the previous one (since copy+paste).
(This is reverted when I simply save >> leave the scene >> reenter the scene.)
-
If I attempt to change the of “B”, not only will it not show up at “B”, but “A” CHANGES.
(This is reverted when I simply save >> leave the scene >> reenter the scene.)
-
If I change the Text of “B” to something different, completely, the of “A” shifts around, yet doesn’t affect the other Text of “A” (just the ).
(This is reverted when I simply save >> leave the scene >> reenter the scene.)
This is repro’d every time in my project in the editor and incredibly frustrating.
(Note that in the video, I’m using a wrapper that includes an <indent=5.5em></indent>
tag within it, but it all does the same)
Noticing these clearable errors:
Mesh.vertices is too small. The supplied vertex array has less vertices than are referenced by the triangles array. (at ?)
UnityEngine.Mesh:set_vertices(Vector3[]) (at ?)
TMPro.TextMeshProUGUI:GenerateTextMesh() (at Library/PackageCache/com.unity.textmeshpro@1.3.0/Scripts/Runtime/TMPro_UGUI_Private.cs:4072)
TMPro.TextMeshProUGUI:OnPreRenderCanvas() (at Library/PackageCache/com.unity.textmeshpro@1.3.0/Scripts/Runtime/TMPro_UGUI_Private.cs:1642)
TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at Library/PackageCache/com.unity.textmeshpro@1.3.0/Scripts/Runtime/TextMeshProUGUI.cs:209) (at ?)
UnityEngine.Canvas:SendWillRenderCanvases() (at ?)
Mesh.uv is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array. (at ?)
UnityEngine.Mesh:set_uv(Vector2[])
TMPro.TextMeshProUGUI:GenerateTextMesh()
TMPro.TextMeshProUGUI:OnPreRenderCanvas()
TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at ?)
UnityEngine.Canvas:SendWillRenderCanvases()
Mesh.uv is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array. (at ?)
UnityEngine.Mesh:set_uv(Vector2[])
TMPro.TextMeshProUGUI:GenerateTextMesh()
TMPro.TextMeshProUGUI:OnPreRenderCanvas()
TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at ?)
UnityEngine.Canvas:SendWillRenderCanvases()
Mesh.colors is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array. (at ?)
UnityEngine.Mesh:set_colors32(Color32[])
TMPro.TextMeshProUGUI:GenerateTextMesh()
TMPro.TextMeshProUGUI:OnPreRenderCanvas()
TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at ?)
UnityEngine.Canvas:SendWillRenderCanvases()
Thanks for the report.
I am able to reproduce this behavior and looking into it.
Great you got it, @Stephan_B – while you’re there, try a few different combos. 2 out of 5 of those textbox’s actually will NOT revert back, doing the opposite:
- If I reload the scene/prefab, it’ll revert back to whatever it started with.
- If I change 1 character, it goes back to what is expected, BUT poofs again when you save + reload the prefab/scene.
- No matter what I’ve tried, I can’t get this to perpetually stay changed to what I want to be – it keeps reverting back to the same text. I’m going to have to delete it and remake it.
Repro’d each time for me here: Make Mockups, Logos, Videos and Designs in Seconds (When it reverts back, you may not see me, but I did CTRL+S, followed by reloading that scene. This demo is in Unicode, but the same happens with English. Notice as soon as I type “test test”, it poofs back to the expected text, only to revert again when the scene is saved and reloaded)
I don’t know how this bug was created differently from the one above, but it was a very similar situation: I’m trying to make sure these are all very similarly-formatted, so it involves copy+pasting TMPro txt’s into another.
EDIT: Yep, avoiding copy+pasting in the tmpro txt component values is the temporary workaround. What seems to work (better than nothing) is to clone a txt and move that in the correct position, then change whatever manually from there. Significantly more tedious, but works for now.
Already working on a solution which will be included in the next package release of TMP. In the meantime, indeed avoid using Copy Component / Paste Component Values with Sub Mesh objects 