Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: HazardousInteractive on April 30, 2014, 09:57:40 PM
-
hello,
How can I make a GUI that hovers over a character to say to show its name/health etc... And gets smaller when the player goes farther or closer, and always faces the player
-
If you are doing it in 2D, then you need to write a script that will scale the game object containing your healthbar based on the distance from the camera to the object the health bar is following.
-
If you are doing it in 2D, then you need to write a script that will scale the game object containing your healthbar based on the distance from the camera to the object the health bar is following.
And how can I make it be above the character?
-
Adjust the Y coordinate relative to the player (or Z, or X, or whatever depending on your setup), either before or after you transform the position from world to camera or whatever.
-
I generally just have a child game object of the 3D object that's offset to be above the 3D object. I target this child object instead of the 3D object, resulting in the 2D UI being offset automatically.