- Home /
Unity hlapi networktransform rigidbody rotation and interpolation issue
I am a relatively new developer developing a simple fps tank multiplayer game with Unity's new HLAPI.
Each player controls their own tank which is a rigidbody.
The controls work by adding forces to the rigidbodys.
I'm using the built in Network Transform component to sync the positions and rotations of the rigidbodys over the network.
Each Tank object has local player authority.
For some reason I just can't seem to get the tanks' rotation to sync properly across devices. It starts off fine but always seems to end up "drifting out of sync" and shaking. By "out of sync" I mean that when the tank turns on one device, it turns on the other device but is not facing in the same direction. The tank may turn from N to NE on one device and then appear to turn from S to SW on another device.
For example: Device A and controlling tank A. At the start, Tank A can drive around and its rotation is correct and syncing nicely to Device B. Then as Tank A drives around and interacts with physics objects in the game, Tank A's rotation on Device B slowly drifts out of sync with Tank A's rotation on device A and also starts constantly shaking.
Does anyone know how to fix this? Thanks in advance.
Its hard to tell you something with no code or an deeper explanation of your setup.