Search Unity

Wheel Collider Prediction

Discussion in 'Multiplayer' started by allencook200, Mar 2, 2021.

  1. allencook200

    allencook200

    Joined:
    Oct 2, 2020
    Posts:
    178
    Should wheel colliders be deterministic enough? I have the exact same simulation on client and server but can't seem to keep them in sync for longer than 1 second at a time, especially during turns.

    My rigidbody character controller stays in sync perfectly fine.
     
  2. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    In order for the physics on the client and the server to give the same result, you need to send all the data that can affect the physical body (position, rotation, velocity and angular velocity) and simulate physics with the same delta
     
  3. allencook200

    allencook200

    Joined:
    Oct 2, 2020
    Posts:
    178
    I did exactly this. The car stays somewhat synced in a straight line, but when I turn, it needs to re-sync all the time. Yes, I synced the wheel collider steer angle and motor torque too.

    Have you personally ever tried predicting wheel colliders before?
     
    Last edited: Mar 6, 2021
  4. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    it should turn out like this
     
  5. allencook200

    allencook200

    Joined:
    Oct 2, 2020
    Posts:
    178
    That doesn't really sound like he's predicting the car's movement, he's just extrapolating it and correcting the position every tick. That's what the description says