The TextMesh
user interface component operates differently than the previous two components. It actually generates a polygonal mesh based on the text rather than display a 2D font or 2D texture. It then places the mesh at the location and orientation specified in the GameObject's transform. This means that we can place this mesh directly in the game world!
One of the useful applications of TextMesh
is that it can be placed in the world at its transform position. This makes it adept at labeling objects that move around the world. This can be done by parenting the TextMesh
component to the GameObject, with a slight vertical offset in the TextMesh
transform.