TextMesh Pro
TextMesh Pro is a tool for displaying high-quality 2D and 3D text in Unity and VRChat worlds. Currently, the following components are exposed to Udon:
- TMP Text (TextMeshProUGUI and TextMeshPro)
- TMP Dropdown
- TMP InputField
You can also user other TextMeshPro components from VRChat's allowlisted world components, but they aren't available in Udon.
Avoid using Unity's built-in text components.
- Unity's built-in text causes aliasing and is limited to 16250 characters.
- TextMesh Pro has better text rendering, rich text, and doesn't have a character limit.
Installation
The TextMesh Pro package is included in the Unity editor. When you use it for the first time in a project, Unity will prompt you to add essential files to your "Assets" folder. For example, creating any TMP component will show the following prompt:
TextMesh Pro's assets can also be imported by selecting "Window" > "TextMeshPro" > "Import TMP Essential Resources".
Importing fonts
TextMesh Pro includes a default font called "LiberationSans SDF." This allows you to get started with TextMesh Pro right away.
You can import your own font into TextMesh Pro with the font asset creator. This generated a font asset that you can use in your TextMesh Pro components.
Font assets increase the download size and RAM requirements of your world. When importing fonts, reduce your atlas resolution and don't import unused characters.
Using VRChat's built-in fallback font
When you import a font into TextMeshPro, it usually won't include every Unicode character. If your world contains strings or user names that aren't in your font asset, TextMeshPro won't be able to render them. For example, instead of "何?!", you may see "□□□".
To use VRChat's TextMeshPro Fallback fonts, go to "Project Settings" > "TextMeshPro settings" remove all "Fallback Font Assets."
This allows your TextMeshPro components to use VRChat's fallback fonts. When you visit your world in VRChat, almost all Unicode characters are rendered correctly.
See also
- TextMeshPro documentation (Unity scripting API)
- Text in Unity - Working with TextMesh Pro (Microsoft Learn)