Hi
I try to extend the "from scratch" example so that the GameObjects that represents the players in the hierarchy show the/change to the playerName which I added to the Gameplayer script. For testing the playerName is hardcoded.
All I have achieved is that either all GameObjects gets the same name or at least one GameObjects name is "Player (Clone)".
I have tried to change the name by using...
TNManager.playerName = playerName;
...and react on it in...
OnNetworkPlayerRenamed(Player p, string prevName) {
transform.name = p.name
}
...but this changes all names of the GameObjects to the same.
I also tried to change the name on creation by...
tno.Send(3, Target.AllSaved, playerName);
[RFC(3)]
void OnSetPlayerName(string name) {
transform.name = name;
}
...with the same result as above.
In every build I changed the hardcoded playerName in the GamePlayer script.
What am I doing wrong? How do I change the GameObject names right?^
Thanks for reading!