Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Using Photon View To Sync WheelCollider how?

Discussion in 'Connected Games' started by DRIVER1ksa, Jan 22, 2017.

  1. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    I'm Making a multiplayer game using photon

    everything is working fine except that other players don't see the Wheel Colliders "suspension distance" updating

    Ive added a photon view component to the Wheel Colliders, and observe but doesn't work



    not sure how wheel wheelcolliders will sync across the network
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,239
    When the PhotonView is set to observe the RCC Wheel Collider script, that should implement OnPhotonSerializeView(). The trick is to write the values that are needed to replicate the behaviour on the remote player's clients (which read the incoming values).
    Also, for remote-controlled vehicles, you must somehow deactivate the physics system or it will try to control someone else's vehicle locally.

    Note: When working with complex physical objects, it's often tricky to make things work when there's network loss and (more or less) random lag. Any delay for networked objects is in contrast with locally controlled, physical objects.
    We don't have a silver bullet to fix this without extra effort, so hopefully you find a solution that works well for your game.