Hello, please help with some issues with unity UI events and TextMeshPro
I have container with text items without layout groups but in content container in Scroll Rect
Hierarchy:
Canvas
Canvas Group
Scroll Rect
Viewport(with mask)
Content
TextMeshProUGUI [25-40 objects]
And when i moving canvas group object just change anchor position, i get this(Deep Profile):
I think it happens because when i move parent object Unity Event System calls OnRectTransformDimensionsChange() and TMP rebuilds layout. But how to get around this ?
This is a long standing issue with the RectTransform that I believe is due to precision / floating point issue where although the size of the RectTransform has not changed, it thinks that it has thus forcing a full update of everything / child of the Canvas.
This mostly occurs when using Stretch mode on the RectTransform or someone in that hierarchy. It is also susceptible to position values like 1.4331 instead of something like 1.45 where those extra decimal places cause the issue.
This issue is one of the reasons why in some users report bad performance on the ScrollRect while other don’t as it is based on those rounding errors in the calc of the offset position of the RectTransform.
See if you can re-work how those are setup to avoid these potential rounding errors.
Thanks, i found solution and problem in my hierarchy on root canvas has been activated option PixelPerfect and as consequence precision issue on child RectTransform. PixelPerfect isn’t perfect.
I am facing this issue and the above solutions didn’t work for me. I am using Unity 2019.3.0f6. I have a canvas for one UI screen which I show it in worldspace. It holds around 15 TextMeshProuGUI components and few image components. When the screen is enabled that initial few frames I could see a very big performance hit. It is happening each time I enable that screen. Can anyone provide me a solution to get a seamless gameFlow without any perfomance hit ?
Having the same issue and still looking for a solution, takes 45.5 ms to Rebuild TextMeshProUGUI on OnEnable of a UI popup. Hope there is a simple solution which we haven’t noticed yet. Using Unity 2019.3.0
See the following post which outlines how I recommend using auto-size.
P.S. I will (once I get a chance / have time) revisit Enabling / Disabling objects to look for potential improvements. I am also working on several other performance improvements but most of them will come from the new TextCore which TMP will use under the hood when it is ready. Ie. improvements will keep coming over time.