- Home /
Sync Array in Multiplayer
Hi, guys. Maybe this question is too simple, but I can't figure it out. I want to Array contents synchronized between clients in Multiplayer. But I not can use [SyncVar] in Array. What I need to use instead of [SyncVar] to achieve the desired. I will be happy with any of your answers )
Answer by tormentoarmagedoom · Feb 21, 2018 at 11:59 AM
Good day.
I had the same problem, and didnt find an "easy solution". There are scripts developed by users to do things like this, but was not working (at least for me) and finnlay did it "manually"
[SyncVar]
public bool variable1, variable2, variable3, variable4
public bool[] variablearray = new bool[4]
And update the information from the array to the variables in the server, (and all clients will sync the variables) and then update from the variables to the array in the clients.
If helped, Accept the answer :D !
Bye!
Your answer

Follow this Question
Related Questions
Play(offsetInSamples) acuracy - still cannot get it to work perfectly 5 Answers
Photon Unity Networking (Viking Demo) Error: Argument is out of range. 1 Answer
How do I keep values synchronized over the Photon Network? 1 Answer
Sending texture updates from client to server 1 Answer
Best way to synchronize projectile transform in networked game? 1 Answer