Unity Photon Name-Tag Problem
Options
So for the last week I have been trying to figure out a name tag system for a photon multiplayer game. I am able to transfer the users input from scene to scene, and put it above the player's head. My issue now is having it synced for other users. I don't fully know how to explain this so let me show you some pictures.
Here is the code I have so far.
http://imgur.com/a/79C94
http://imgur.com/a/hCX3k
http://imgur.com/a/rCPjI
Here is choosing your name and the outcome of two clients connected to the server.
http://imgur.com/a/QwRyZ
http://imgur.com/a/u7bCw
Here is the code I have so far.
http://imgur.com/a/79C94
http://imgur.com/a/hCX3k
http://imgur.com/a/rCPjI
Here is choosing your name and the outcome of two clients connected to the server.
http://imgur.com/a/QwRyZ
http://imgur.com/a/u7bCw
0
Best Answer
-
Alright so I figured it out! Thanks to ChristianSimon (on the unity forums), and one of my friends. First off I didn't have Photon updated in unity which made some things obsolete I think.
I only needed to use two scripts for it to work instead of three. Here is a picture: http://imgur.com/a/cMR44
The first script is the PlayerNamePlate script. It obtained the users input and carried it over to the lobby scene where people can play.
The Second script did all the magic. On the start method I set the PhotonNetwork.player.NickName to be equal to the users Input. Next, In the update function I set the players Name-Tag to be equal the PhotonView.owner.Nickname.
From there it updates the player names correctly, hopefully I explained everything well. If I did not let me know and ill see if I can do a better job.0
Answers
-
Alright so I figured it out! Thanks to ChristianSimon (on the unity forums), and one of my friends. First off I didn't have Photon updated in unity which made some things obsolete I think.
I only needed to use two scripts for it to work instead of three. Here is a picture: http://imgur.com/a/cMR44
The first script is the PlayerNamePlate script. It obtained the users input and carried it over to the lobby scene where people can play.
The Second script did all the magic. On the start method I set the PhotonNetwork.player.NickName to be equal to the users Input. Next, In the update function I set the players Name-Tag to be equal the PhotonView.owner.Nickname.
From there it updates the player names correctly, hopefully I explained everything well. If I did not let me know and ill see if I can do a better job.0