- Home /
Photon Unity Networking (instantiated object syncing)
I'm shooting another player with an arrow. The hit is registering, I have a Debug.Log in there. The way I "hit" the other player is it changes their renderer.UseLightProbes to TRUE. In their code, they check for that value and decrease health if it is true.
All this code works fine. When building and running alongside my editor (2 games open at once) it changes UseLightProbes in the editor but it doesn't change the value in the other client.
How would I go about syncing this value across all clients or, more accurately, syncing each player and their code?
Are you successfully synchronizing that you shoot in the first place? Does the arrow fly? You could sent an RPC for the case "I hit you". For example implenent "HitBy" and call it as RPC. See: http://doc.exitgames.com/en/pun/current/tutorials/tutorial-marco-polo
I have a collision between the arrow and the player. The arrow does fly on both clients and successfully triggers the collider, but only on the client who fired the arrow. The other clients in the scene are not affected on their machines.