- Home /
Player label appears in sky!
Hello,
I am displaying the player name above him in a Photon based multiplayer game using:
Vector3 offset = new Vector3(0, 2, 0); // height above the target position
Vector3 point = Camera.main.WorldToScreenPoint(transform.position + offset);
point.y = Screen.height - point.y;
GUIStyle style = new GUIStyle();
style.alignment = TextAnchor.MiddleCenter;
style.normal.textColor = Color.cyan;
style.fontStyle = FontStyle.Bold;
string name = GetComponent<PhotonView>().owner.name;
GUI.Label(new Rect(point.x - 50, point.y - 20, 100, 15), name, style);
This works fine except for the fact that the name label also appears in the sky for each player! I can't figure out why this is, can anyone help?
Thanks, Collywobbles
No ideas? Surely somebody else has encountered this issue.
What exactly is your problem? I can't tell weather your labels are in the wrong place or they are duplicated.
The label is duplicated. It appears above the player head as defined in the code, but when I look around with mouse-look it is also floating in the sky just to the right of the sun in my skybox. The label remains in place above the player as I look around so it is not moving.
Your answer
Follow this Question
Related Questions
Dynamic Resizing of tooltip to match content? 1 Answer
(GUI.Label) Line spacing issue with wordwrap 0 Answers
FLYING from Camera Position A to B per Buttom click? 5 Answers
GUI Window on GameObject location? 1 Answer
Game simple intro/ending 1 Answer