u-3300 Text Mesh Pro TMP Canvas
TextMeshPro UI Setup in Unity
1. Canvas Requirement
All TextMeshPro (TMP) UI components must be placed within a Canvas. The Canvas serves as the foundational rendering layer for UI elements. Ensure a Canvas is present in the scene before creating any TMP components. TMP elements should be added as children of the Canvas to function correctly.
2. Supported Canvas Render Modes
TMP supports three distinct canvas layouts to accommodate different scene requirements:
| Code | Render Mode | Description |
|---|---|---|
| U-3310 | Screen Space – Overlay | Renders UI directly on screen, ideal for HUDs. |
| U-3320 | Screen Space – Camera | UI is rendered by a specific camera, allowing depth and layering. |
| U-3330 | World Space | UI behaves like 3D objects in the scene, useful for in-world interactions. |
3. Importing TMP Essentials
Before using TMP components, ensure the TMP Essentials are imported:
- Navigate to Window → TextMeshPro → Import TMP Essentials
- This installs necessary shaders, fonts, and default assets.
⚠️ Important: TMP text will not render if required fonts or assets are missing. Unity does not display an error message in this case, so manual verification is essential.
4. Common Issue: Text Color Not Updating
If text color changes are not reflected, verify the following:
The TMP component is not using a material preset that overrides color settings.
The assigned font asset supports color overrides.