I’ve been working on a networked first-person project for school, and I was trying to find a way to locally disable some gameobjects which are children of the player game object. These gameobjects hold the meshes of the avatar the local player uses. The problem is, when i attempt to disable them, (and i believe this is because of the network transform component attached to the parent (which is necessary)) it affects all clients’ views of the player. Thus, when i attempt to only locally disable every player’s respective meshes, every client just sees nothing, as though there are no players. As in, let’s say player 2 of 4 would locally disable his avatar’s mesh so he doesnt see it yet everyone else can, and the same for every other player. But the network transform (i believe) forces everything to sync, so it shows up on everyone’s window. Is there any way around this?
Hmmm i belive you can do it something like this . This code is not yet tested but it will help you i am sure.
public GameObject onChild;
public GameObject DisableObjectOnChild(){
onChild.GetComponent<MeshRendere>().enabled = false;
}
// or you can do it something like this
/ Use this for initialization
void Start () {
transform.Find("Child").GetComponent<MeshRenderer>().enabled = false;
}
hope it will help you