[PUN] Player Name


I need some kind of player name above players. I tried on time with Photon.player.name but it just used your own name. How can I make a 3D text say the player’s name?


private var worldNamePos : Vector3;

function OnGUI()
     worldNamePos = Camera.main.camera.WorldToScreenPoint(Vector3(transform.position.x, transform.position.y + 2.0, transform.position.z));
     GUI.Label (Rect (worldNamePos .x - 50, Screen.height - worldNamePos .y - 48, 100, 50), "Name");


For 3D Text, you just use the character’s transform.position with an y-offset appropriate for the figure’s height.