UNET Multiplayer Vehicle Movement sync issues
Hi!
I'm just starting out in UNet and unity in general. I'm trying to implement the default vehicle asset, in multiplayer. I'm doing this by replicating the "MOVE" method call in the server and in every client. It works for about 1-2 seconds, and then more I drive around, the worse the sync gets between the clients and the server. There must be a better way of doing this, because I have two identical methods, but one is the rpc call and the other is the command. I captured a little video demonstrating the problem: Video demonstrating the problem
And here is how I've done the coding(Pseudo code):
FP Controller script:
void updateCar()
{
-(Getting input)
carUserControl.m_Car.CmdMove(h, v, v, handbrake);
}
Car User Control script:
public void CmdMove(float steering, float accel, float footbrake, float handbrake)
{
-(Moving the car)
RpcMove(steering, accel, footbrake, handbrake);
}
void RpcMove(float steering, float accel, float footbrake, float handbrake)
{
-(Moving the car)
}
Your answer
Follow this Question
Related Questions
Unet Syncing Flashlights 2 Answers
Sync movements Photon 0 Answers
Problems syncing players in multiplayer 0 Answers
Photon Sync Var 1 Answer
Multy Player both players are moving 0 Answers