Hi Chris,
I'm using Unity UI for conversation lists and have noticed the following in my builds:
1. The first time the conversation panel is opened up there is a little jerky hiccup/delay
2. Subsequently the panel is much smoother
I don't see this in the editor, however - even when using a rather large game window.
Do you see similar behavior?
Comments
If the problem is due to pre-caching fonts, then it'll be an issue with Unity rather than AC. Perhaps you could preload them by having another UI with the same fonts display at the start of your game, only with an alpha value of zero.
Sorry for bumping such an old thread, but I thought I should highlight this is still a Unity issue in Nov 2023, and this thread was a life saver!
I spent a long time today rewriting a script that resizes a scrolling TMPro speech bubble according to a non-scrolling dummy so that the initial size of the bubble is the same as the final one. This is a little complicated if you want to do it right because, if you just set a maximum width to the text object, the longest line won't necessarily be as wide as that width because of line breaks. So once the text is laid out on the dummy and you know the size TMPro is using, you need to check the width of the longest line and resize the text object again to exactly that width. Anyway, the point is that the script was a bit heavier than it should have been, and the hiccup dxmachina was talking about became really apparent.
Optimising the script helped a bit, but it did not solve the hiccup issue altogether. I thought this was an issue with the way AC loaded menus, so I even tried running "AC.PlayerMenus.GetMenuWithName("Subtitles (Unity UI)").LoadUnityUI();" at the start of my game, but it did not help.
What helped was Chris' suggestion above. I added a small TMPro object using the same font to the game's first scene, and the hiccup was completely gone. So I'm bumping this solution to keep it relevant and easily searchable.