Posted May 12, 2025 by BeenCha
#unity #UI Toolkit #interface
Short update version - Changes are on their way, I made a new font I'm happy with, and some more flair and style on the chat interface. The changes are hefty behind the scenes, so it will still take awhile - scroll down for more technical detail, or just enjoy the preview screenshot for now - more animated text is coming tooooooo ๐
The end of a romance always needs a good back story - why did I use Unity's relatively new but also under-developed UI Toolkit? I'd like to say it was because I was young and frivolous, but I am old and experienced, so I should know better. I was lured by the CSS like USS, the easy animation through transitions, the JQuery like document query etc - it felt nostalgic for my web development days, and looked like a simple way to handle lots of issues to do with multiple screen sizes.
I'd also managed in another project to make and inventory system, and the custom VisualElements and behaviours were quite fun. Being so familiar with webdev and design I could quickly knock out interfaces, so prototyping and alpha building become quick and easy.
But the honeymoon started to fade.
Having a separate Builder window that is a bit clunky, has made me hesitant to adjust parts of the interface - what started quick and fun has become laborious - adding one new button requires opening the laggy Builder, adjusting classes until the part of the interface I need is visible, then setting them back, then adding a new query in a script... tie in ongoing issues on false positives on invisible elements vs no-display for click events... it's become an unruly beast to maintain.
I was also frustrated with the very minimal animation tools and options for typewriter-style text - <alpha> simply doesn't work the way it should and Unity doesn't care for my bug report, which made that effect even harder. Having been in design and typography, it frustrated me when people have typewriting effects where words knock over to the next as they type - it's messy! I should be able to just to "written text part<alpha=0>ial words." which would show the characters as transparent prevent knocking over of words - but alas <alpha> isn't compatible with borders, shadows, pretty much anything that adds flare ๐
Digging into Unity's official project on how to use the system and seeing very hacky texture rendering of effects rammed into Visual Elements, had me doubting my choice further. And without making one crazy interface structure, I started to get weird performance issues around reflowing (and clearly their internal use of essentially a TMPPro system) when having multiple UIDocuments on screen.
Bring the love back - I thought.
So I pursued some more exciting text animation, wobbly movement, words floating etc - using the hacky texture rendering system that Unity themselves were suggesting - I thought I could marry the fun freedom of TMP Pro and UGUI into a UI Toolkit Visual Element - and while I had some successes, the management was still a pain, and instead of simplifying that - I'd made it worse.
The allure of the sexy text animation was too much. The freedom to make funky shaders for my windows tipped me over the edge.
Now I had seen what I could do with emphasising words, and making much more interesting text transitions, I just couldn't let it go. So here I am, with an overly complicated UI Toolkit set-up I'm slowly deconstructing - I've tried where I can not to need to fully recreate all parts and focus on the main chat interface, so I can chip away at the other parts.
Final advice?
Honestly, I'm still a little heartbroken, UI Toolkit has such promise, but the development on it is so slow, and basic bugs are being ignored - it feels like an internal teams project, and the team is gone, and Unity is just trying to keep it running for those of us who took their promises to heart. I think it might still have a place for quick interface layouts and building - but don't get too deep with it, it'll break your heart ๐