Hello, my code:
void OnGUI() {
Vector3 offset = new Vector3(0, 3, 0);
Vector3 point = Camera.main.WorldToScreenPoint(transform.position + offset);
point.y = Screen.height - point.y;
GUI.Label(new Rect(point.x - 35, point.y - 20, 200, 20), PhotonNetwork.playerName);
}
This code show nickname above character. The problem is all characters have same name - the local players one. This happen because of “playerName” which show only local player name, not the others. So, is there any variable to fix it?
Secondly - how to modificate my code to show only team members? For example:
if(datPlayer == myTeamID)//my team
{
goAndShowHisNickname;
}
else
{
doNotShowIt;
}
Can I create code like that? Or it wouldn’t work in multi?