I have a vehicle with custom wheels which are connected to it by the HingeJoint components. Everything works perfectly when using this car in single-player mode. Wheels are actually as
Cylinders. They have
HingeJoints attached through which they are bound to the vehicle's
Rigidbody. Then I set
JointMotor.force and the wheels are getting rotated and the vehicle is moving. It all works very naturally in terms of physics, I don't need to emulate anything.
Still, there is an issue with network synchronization in multiplayer mode and I have no idea how to solve it.
It's said that the proper way to sync the position of a physical object is to use
rigidbody.MovePosition(), but any manipulation with
Rigidbody leads to the collapse of the vehicle hinge-joints. The only method that works is setting
transform.position directly. But this is not recommended for physics and it doesn't allow to synchronize the vehicle smoothly with no twitching. Is there a way to solve this somehow?
I'm using Photon for networking (if it matters in the question context).