I am trying to make it so when the user chooses a different face, helmet, and body texture it will reflect on others machines. When the user picks whatever items they want everyone who comes in looks the same as that user. I am using RPC to apply different materials to the user but for some reason its not working.
[RPC]
void SetCharacterLook(int face, int body, int helmet)
{
playerFaceMaterial.mainTexture = faceTextures[face];
playerBodyMaterial.mainTexture = bodyTextures[body];
playerHelmetMaterial.mainTexture = helmetTextures[helmet];
}
Then in Update I am calling
networkView.RPC("SetCharacterLook", RPCMode.AllBuffered, Variables.faceTextureId, Variables.bodyTextureId, Variables.helmetTextureId);
I tried moving it to start, awake in another rpc call that works, but same thing everytime. Any idea?
Edit: It looks like you can’t edit the material of an object. Since all the people getting created with the same material it changes all the materials. need to figure out how to make an instance of the material and apply it at the start…