- Home /
[Solved] Changing material through network PUN
Hey guys, started making a multiplayer game with the PUN extension. I am now trying to change the material of the mesh after pushing a key. If I test it on my machine alone it works they way it should. But if I build and run a copy, and run it in Unity and push the same button, the material changes the way it should but it does not change in the View Port or the built window. I have it set up so there is a PhotonView on the Parent object and I am trying to change the child object which is currently still a capsule. As the graphics game object I added the child object. What am I missing in order to portray it over the network and not just on my own machine when I run it alone? Any help is greatly appreciated. Demonstrating it in the screen shots.`
public GameObject graphics;
void Update() { if(Input.GetKeyDown(KeyCode.F)) { ActivateCloak(); } }
void ActivateCloak() { graphics.renderer.material = cloakMat; Debug.Log("Cloak Activated"); }`
Answer by karl_jones · May 18, 2015 at 08:46 AM
Are you sending the material information over the network? Look at using an RPC to send the new material data to all the other clients. The PUN examples show hot to do this, e.g marco polo example.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Unity Collision Doesn't Work when Two Players Instantiated 1 Answer
Can I change a material name using AssetPostprocessor.OnPreprocessModel 1 Answer
How to connect to our own dedicated server using photon networking in unity?(Self-hosted) 0 Answers