Search Unity

Rigidbody Syncing in UNet

Discussion in 'UNet' started by Sethtek_Dev, Jul 3, 2019.

  1. Sethtek_Dev

    Sethtek_Dev

    Joined:
    Feb 4, 2017
    Posts:
    44
    Hello,
    I'm currently trying to implement multiplayer into my vehicle game, it works good for now.

    The problem comes in when I try to move my vehicles around in the game. Everything appears correctly on the client, where you're actually controlling the vehicle. But on the other client where you see the vehicle, it fails at rotation, position, velocity, and sometimes even faces the wrong way.

    I made a video demonstrating what this does sometimes.


    Here are my NetworkTransform component configurations. I've tried to play around with these, but with no luck.

    upload_2019-7-3_17-47-2.png

    I set it back to the default, because no adjustments I made seemed to fix it.
    Also, it needs to use Sync Rigidbody 3D, because the vehicles are based off of rigidbody physics. I tried setting it to Sync Transform, but that didn't fit with what I'm trying to do.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The parameters of the NetworkTransform component were never properly documented, and it really never worked all that great. I found it useful for prototyping, but that's about it.

    Unet is deprecated, and all but abandoned, so I'd suggest switching to an alternative API before you get any further into developing your game. But sticking with Unet, you can implement your own replacement for NetworkTransform with a NetworkBehaviour script using Commands and ClientRpcs. Then since you're writing the script you can tune the interpolation to fit the specific needs of your game.