Two Ways to do Text in Unity are:
OnGUI and UIText (Text Mesh Pro) - there are actually two ways here. There is the screen text using the canvas and event handler and there is also the 3d text. I like using OnGUI for debugging - quick easy way to show some information on the screen.
Source Code: https://github.com/omarvision/TextTwo...
Playable Demo: simmer.io