How do you create text that can be the child of a non-canvas object?

I need text that will move with an object. In older versions of unity, I would have used 3d text.

Creat an empty game object. Write a script using GUI.Label that writes out your text. Attach that code to the empty. Now child the empty to the main camera and child the camera to the game object. Is this the sort of thing you need?