How to move 3D Text according to the GameObject ?

Hi All,

  1. How should i move the position(Display of Text should follow the Gameobject) of 3DText along with the GameObject?

Example : If i move the GameObject in Y axis the 3D Text also move in Y direction , If GameObject moves in Z axis the 3DText should move in Z-direction.

  1. Is it possible to get the exact Z-coordinate, When i click the mouse on the Screen ?
    Will ScreenToWorldPoint will work out ?

Please help me Regarding these issues.

Thank you in advance...

You can parent the 3d Text to the GameObject, which is probably the simplest way, or you could move it through script:

var text : GameObject;
var object : GameObject;

text.transform.position = object.transform.position;