- Home /
i want to insert name on character
Before
After
when i click the play button,
i want to insert name on a character as second screenshot
how can I do this??
i have learned unity3D for 1 week..
Answer by Josh Naylor · Jul 10, 2014 at 09:35 AM
Add a new 3dText and place it on your character as a child like this: http://gyazo.com/ba1b0b5e7ff81fb74a1a8d7c81a45cde
And use Transform.LookAt function in order to get the text face your player all the time.
Answer by Tehnique · Jul 10, 2014 at 11:08 AM
If you want to use a label, you have to calculate the position. Something like this:
Vector3 wantedPos = Camera.main.WorldToScreenPoint(transform.position + Vector3.up * 1.3f);
GUI.Label(new Rect(wantedPos.x, Screen.height- wantedPos.y, 50, 20), "AAA");
You would have to play around a little with the numbers (1.3f) in order to get it to look good.
Answer by alok.kr.029.hotmail · Jul 10, 2014 at 11:58 AM
1.insert the 3dtext 2. make it the child of the character 3. attach the lookat script on the text and make the target camera