- Home /
Synchronizing Variables across network
So Currently I am working on a project where we have a Master Server (Seperate Unity Project) which clients connect to and run their own world.
The issue I am currently having is with the replication of the Script class Trainee we have. The Trainee is instantiated on the Client via Network.Instantiate and we have that on all the clients and master server.
The issue comes with replicating the information from the Clients Trainee to the server.
We have a simple
public bool IsReady;
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)
{
bool isReady = IsReady;
if(stream.IsWriting)
{
isReady = IsReady;
stream.Serialize(ref isReady);
}
else
{
stream.Serialize(ref isReady);
IsReady = isReady;
}
}
The issue we now have is that the data is not replicated, Nothing has been changed outside of what unity automatically generates in a network view. Another thing to note is that I can see the OnSerializeNetworkView is called on the client but never on the server. I am very new to networked multiplayer and any help as to why I can't get this data to replicate would be helpful.
Answer by captaincheerios · Sep 08, 2011 at 04:58 PM
Solved it, needed a seperate NetworkView for the Script.
Your answer
Follow this Question
Related Questions
HLAPI SyncVars property setter function 1 Answer
Unity networking tutorial? 6 Answers
HLAPI RPC synchronization - how to wait for a RPC 2 Answers
SyncVar is not changing on server 1 Answer
State synchronization non-functional after mode change? 0 Answers