Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Multiplayer NetworkTransform with rigidbodies jumping

Discussion in 'Multiplayer' started by Carpe-Denius, Jun 20, 2015.

  1. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Hi,
    does anyone know a solution (or the right settings) for two rigidbodies, one on a client, one on a server?
    If I enter my car and make the car a player object, I can drive it and it gets syncronized like it should.
    But if I hit another one, they ignore collisions until the next sync and then jump in the air, since they are half overlapping.
    If I put both on the server, I can't drive them anymore.
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    why do they ignore collisions? nothing in the networking would make them do that.
     
  3. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    In frames, 60 FPS, 30 updates per second:
    1. Client sends position A, just before collision
    2. Client sends nothing, collides with other car
    3. Client sends position B, after collision. Server updates the client object and they are suddenly overlapping. Physics get calculated and they explode from another


    Edit: oh my god, I'm so sorry. One of the colliders was on the wrong layer.
     
    Last edited: Jun 20, 2015