Displaying text that isn't a UI

I want to make a SpeedTyper kind of game.
Now for the words that appear on the screen I use UI text game object.
My question is, should I really use a UI element for that? the text is constantly moving and Rect Transform position is giving me weird results.
Is there another way to display like text on the screen? bare in mind that I don’t want to use an image or some sort since it’s a speedtyper and it will be really inconvenient…

TextMesh

Hm, I am trying that but is there a reason the text looks so bad?
Also it says the in the manual that it’s used for 3d and for 2d I should use GUI text but GUI text is outdated

Using TextMesh looks fine, but to make it look okay I had to increase the fontsize to like 40 and reduce the character size to 0.2 so it won’t take the entire screen, is that normal thing to do?

I am also interested in this.

The text solutions built into Unity are sub-par. I and many others use Text Mesh Pro to improve the quality.

All that said, UI.Text ought to work just fine for this. You say “Rect Transform position is giving me weird results,” but that probably just means you don’t understand it. A little time invested into learning RectTransform will serve you well for years to come.

By that i mean when i move a UI on the screen through the editor, the x and y of the RectTransform are different when i move them by the scirpt. in other words the x and y may be the same but they are placed on different parts of the screen. hope you understand the issue i had.

Yes, I do. When you’re using a RectTransform, the actual position of the transform is calculated from the other properties, like anchorMin, anchorMax, anchoredPosition, sizeDelta, and pivot. This is how things can properly position themselves even when the screen size or aspect ratio changes.

If you toggle between “normal” and “debug” views in the Inspector while experimenting with your UI element, you can pretty quickly get a feel for what’s going on. And with a bit of study you can actually understand it. I still think that time is a good investment. It’s not all that complicated, and it’s really powerful.

1 Like

Oh i see. so it had different values based on the screen res.
I will probablu study it more carefully at some point.

1 Like