- Home /
Text that follows players and scale according to camera zoom
My game has 3~9 tanks that needs to show its name above their sprites. The game can be zoomed in or out so i can't just use GUI.Label because the size would stay constant. Is there another object type that can scale based on camera zoom? If I have to scale GUI.Label myself, how would i do that? The label is 200pixel in width and 50pixel in height. I was able to place it where i want but i am having hard time converting pixels to screen points.
Answer by fafase · Feb 19, 2014 at 06:07 AM
You can use 3DText. It is place in the world. Only problem is that it is using a GUI shader and then shows through any object. That means if your object is behind a wall, you will see the name through on the wall. Just a 3DText object, place it above the object and attach it.
You can fix the shader from here: http://wiki.unity3d.com/index.php?title=3DText
If you need to display some health use a plane with the same process.
actually, my problem is that the text is shown behind my tank. i want it to be always on the top. How do I change this? i am not using special shader from your link.
Your answer
Follow this Question
Related Questions
Multiple Lines in a GUI.Label 2 Answers
Help with making a triggered gui message 1 Answer
Break the limits on text area 0 Answers
Unity crashes at writing TextMesh? 0 Answers
The variable m_Font of 'GUISkin' doesn't exist anymore 1 Answer