It only happens when the first text mesh pro component overflows into the linked one.
Yes, scene 16 works.
I sadly cannot provide steps because how inconsistent it is. I tried to recreate it in a different scene but it didn’t work. The error will go away for a while and then come back.
Just to recap…
(1) Recreating a similar setup in a new scene does not produce errors.
(2) Remaking the objects in the same scene produces these errors.
Comparing both setup, what are the differences?
Is the text exactly the same in both cases?
How about the size of the RectTransform?
Are you using any Layout components in one case but not in the other?
Are you able to export a simple scene the produces the error and provide it to me?
My goal is to simply wrap the text around the image. You can see it actually works in Scene view a little bit, but if I select any element, or save the scene, or interact with Unity in any way, the text in the lower ‘Overflow’ Text Mesh Pro object vanishes, and sometimes the IndexOutOfRangeException previously described in this thread happens. At runtime it’s worse yet; the only way to get the text to display is to edit the text, where it displays the text correctly and triggers the error alternatively with every key stroke.
Odd, inconsistent behaviour aside, it’s not hard to reproduce. My layout groups/elements for the above Scene Hierarchy are as follows:
The Vertical Layout Container has ‘Control Child Size’ on for both Width and Height, but I only Child Force Expand on Width.
Both ‘Row 1’ and ‘Row 2’ have a Horizontal Layout Group. Row 1 has Control Child Size turned on for Width only.
Row 2 has Control Child Size turned on for both Width and Height, and Child Force Expand on for Height only.
The image has a Layout Element which enforces a Min and Preferred width and height to keep it square.
There are no Layout Elements applied to either the Text Mesh Pro objects.
Pretty straightforward. My guess is that the Layout Manager’s height calculation is fighting with Text Mesh mesh calculation.
If there’s an easier way to wrap text around the image (not involving TMPro Sprite Assets, I need to use images here) using Layout Groups, I’m keen to hear it, otherwise a fix for this bug would be great.
Can confirm this issue is fixed in 2.1.0-preview.8.
Thanks Stephan!
Sorry - had a click around and couldn’t find any information about Text Mesh Pro’s preview packages or the release cycle; what is the expectation of stability for them? Do you recommend or discourage shipping products with them? Obviously in this case it would be great to commit to using preview.8, but I don’t know how unstable previews can be.
I strongly encourage everyone to test these previous as they contain new functionality and fixes.and to report potential issues. Now if throughout your testing everything appears to be working as expected then by all means continue to use this preview.