Vehicle movement by LAN

Hi

I’ve created simple car, front wheels with torque and twisted wheels. It works … so play by lan left.
First I’ve added Network View to prefab of vehicle. On ‘Observed’ property I’ve got “buggy(Transform)”. Buggy is the name of prefab. I’ve created server and client … and Go !!. Notice that i haven’t added OnSerializeNetworkView() method anywhere … and the car is moving by lan. This is the first thing I don’t understand. But let’s go further.
The car is moving by lan by transforming it’s position ( wheels doesn’t spin ). I think that because in Observer we’ve got buggy(Transfrom) so the transform position is sended by lan.

Second thing is to send spinning and twisting wheels. I’ve added OnSerializeNetworkView() method and added there moving wheels … nothing is happening. Wheels are stuck.
So I’ve decided to go for [RPC]. And finally:

  1. moving car is going threw Network View transformation
  2. Spinning wheels are going threw [RPC]

I think that this isn’t a good idea. In fact I was think that I will send only wheels torque ( left and right ) and all the transformation will be done by physics on the clients sides.

Any advice ?

You could save the transform.position every X amount of time then figure out the movement speed by the distance traveled over that time and then spin the wheels the correct speed/amount.

This should only need to be done client side thus adding no complexity to the network code.