I’m making a multiplayer game with Photon. I’ve been able to get name tags synched and everyone has their name displayed with TextMesh and Transform.LookAt. The only problem is, when someone clicks out of the game window, it stops rotating to face the camera. Anyone know what I Can use instead? The name is synchronized when a player joins the game and the string that is their name is then placed into the MeshText.text field. Anyone know what I can use instead or how to fix this?
Add a 3d text component to an empty object and put that in ur player. Next add this script:
public string getPlayerName;
public TextMesh NAMEPLATE;
void Awake () {
NAMEPLATE = gameObject.GetComponent<TextMesh>();
networkView.RPC("getName", RPCMode.AllBuffered, PlayerPrefs.GetString("Player_Name"));
}
[RPC]
public void getName (string name) {
NAMEPLATE.text = name;
}
when making your player, give the option to have a name, and save it to playerprefs as Player_Name
drag the object with the component to the variable called NAMEPLATE.
This worked for me yw