UI Toolkit Ingame Chat with emojis

Hey,

im currently trying to integrate an ingame chat with ui toolkit.
Is it possible to add emoji support and also maybe gifs.

I want to create something similar like the discord chat.

Thanks for your help.

Hello, emoji support has been added.

There is no gif support in UI Toolkit. You can cycle through a bunch of images using a VisualElement background and the built-in VisualElement.schedule.Execute() scheduler.

Hi,

thank you for the fast reply.
Thats great.

Is there a possibility to add an emoji selection like in discord


without creating a button manually for every emoji?

Because the only way i could think of right now is creating a button and then add the emoji as image and when pressing the button the emoji “text (or how thats called)” gets added to the string.

Also for some reason i can paste the heart from discord which is :heart : inside an input field but when manually writing this no heart shows up. (I added a space after heart to prevent the heart emoji from showing up here)
image

Hi @laila-chammaa , I am not sure how I can fix this. We upgraded our project to Unity 6 (from 21 LTS) couple of weeks ago, and I didn’t know the native emoji support. We’re using NotoEmoji for emoji support, but we want to remove it. I tried removing it, but the emojis won’t be visible in the game. But, I can see native emojis in UI Builder. I don’t know why is this happening, so do you have any idea what might cause this? I am attaching a screenshot. I didn’t remove NotoEmoji to show you the problem, but if I remove it, no emojis are shown.

And, @Lemior , you can use this list to list all the emojis I think (you can use a loop to create the buttons then). I am not sure if there’s a possible way to trigger native virtual emoji selector (eg like macos’); for mobile, there is this for iOS but I am not sure if it’s still works. I think the custom way is the safest way, and you can filter out any emoji you want.

Hey there! I’ve worked on native emoji support, so I can help clarify.

The UI Builder uses the Editor Font Fallback chain which has emoji fallback setup. At runtime, you are using a different TextSettings than the editor one which explains the differences. You’ll need to setup your own TextSettings for your runtime UI Documents. For Emoji support, you’ll need to assign your own Color Emoji Font in the TextSettings fallback. This process is briefly explained in the documentation.

Keep in mind a limitation: Some OpenType font features, such as chain context and single substitution, aren’t supported.

I noticed you’re using color modifiers, which TextCore doesn’t fully support due to its lack of OpenType support. However, we’re working on a new TextGenerator that properly supports these features. If you’re interested, you can check it out in this thread. Note that it’s still behind an experimental flag in U6.

Hope this helps! Let me know if you have more questions.

1 Like