- Home /
Network.Instance doesn't instance updated TextMesh
Hello,
The thing I'm trying to achieve seems so straightforward that I think that I stumbled upon a bug. Please help me prove I'm wrong :)
I have a prefab named "Avatar" with a 3DText child named "myName". "myName" has a TextMesh component and "Avatar" has a network view. The following script is attached to an empty object and the prefab "Avatar" is set to characterPrefab.
When the user chooses his/her player from a list, a RPC is called that fetches a bunch of data from a local sqlite database and when it finishes it, it calls the following RPC (targeted specifically to calling user):
var characterPrefab : Transform;
var tm : TextMesh;
@RPC
function loadPlayerDataResponse(playerName : String){
tm = characterPrefab.Find("myName").GetComponent(TextMesh);
tm.text = playerName;
Network.Instantiate(characterPrefab, Vector3(0,-10,0),Quaternion.identity,0);
}
The problem is that on my client the player's name shows correctly above the model's head, but on the server it doesn't. When you perform a network instance shouldn't a copy of the prefab (and children) be displayed in all clients connected to the server?
Thanks.