1
\$\begingroup\$

In all tutorials they are using canvas for the text to put the text above the player/object.

Why not just make empty GameObject as child of the object you want to add the text above and add to the empty GameObject TextMesh and that's it ? What the canvas is giving me for this case when I want to put text above any object ?

Text above object

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can use a canvas for example for UI of your, 2D games, handle scaling easily or anchoring. It is just another tool that is for you available. If it suits your needs, you can use it. Does not mean you HAVE to use it \$\endgroup\$
    – Zibelas
    Jan 18 at 10:23
  • 1
    \$\begingroup\$ Why do none of the tutorials you watch mention the TextMesh component and compare it with screen space canvases? Because about 90% of Unity tutorials on YouTube are crap. Most of them are made by people who are still beginners themselves. They are often showing stuff they learned from other Youtube tutorial creators. They either don't realize that there is more than one way to achieve what they are trying to do. Or when they do realize it, they don't find it necessary to take the time to discuss multiple techniques and when to use which. \$\endgroup\$
    – Philipp
    Jan 18 at 11:50

1 Answer 1

4
\$\begingroup\$

The TextMesh component (or its superior alternative TextMeshPro) is perfectly fine if a naked text is all your want to show. That's what it's for. But a world-space canvas has benefits when you have more than one UI-element to attach to an object. Like, for example, a panel with a border and a background which contains the name, a health bar and a couple status icons. The main benefit in that use-case is that you can utilize the layouting capabilities of the canvas. You can design the layout of the canvas in 2d and then place the whole canvas as a single sprite-like object in 3d space.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .