[RCC]
static GameObject CreatePlayer (GameObject prefab, Vector3 pos, Quaternion rot)
{
// Instantiate the prefab
GameObject go = prefab.Instantiate();
// Set the position and rotation based on the passed values
Transform t = go.transform;
t.position = pos;
t.rotation = rot;
go.name = "player" + TNManager.playerID; // The name of the gameobject is the same for each player that joins
return go;
}
If im correct, this part will get called on all players. And when someone's joins the game, my game calls this function to create the other player and it will use my "TNManager.playerID".
I suggest you, if you have an class on your Player Gameobject, for example called "Player.cs" to put in the Start() this code:
if (tno.isMine)
{
gameObject.name = TNManager.playerName + "_" + tno.ownerID;
}else{
gameObject.name = TNManager.GetPlayer(tno.ownerID).name + "_" + tno.ownerID;
}
Thats, how i do it. (Don't forget, to set the Playername before joining)