Search Unity

[BUG] Scene object NetworkTransform is not syncing rigidbody for new clients

Discussion in 'Multiplayer' started by montyfi, Aug 10, 2015.

  1. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    It seems scene objects have a serious bug at the moment. Or I don't understand how to sync them.

    Add a sphere with Rigidbody and NetworkIdentity to scene and move it from Vector3.Zero. Run the game, sphere position is in sync between client and server.

    Add network transform to the same object. Server displays it at the correct position, but client suddenly shows it at Vector3.Zero and position is not synced until server apply force to it. After this action position seems to be in sync.

    Any ideas how to fix it?
     
  2. Deleted User

    Deleted User

    Guest

    You probably need to spawn that prefab with NetworkServer.Spawn(), or use NetworkServer.SpawnObjects();
     
  3. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    I don't wanna spawn prefabs it will cause a huge refactoring for me, scene objects exist for a reason, aren't they? And NetworkServer.SpawnObjects() called automatically, otherwise Scene Object would not be enabled.

    Submitted a bug with attached networking example, all I did is just added one scene object to Unity example, case ID 719156, I would really appreciate if someone from Unity will look into that issue, it is quite a showstopper. Thank you.

    More information:
    Editor Host + Standalone Client - Reproducible
    Standalone Host + Standalone Client - Reproducible
    Standalone Host + Editor Client - NOT Reproducible, which is really strange.
     
  4. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    That project with the bug works fine when I ran it. Are you using the latest patch release of the editor?
     
  5. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Thank you for looking at it.
    5.1.2.p1 - later versions have nothing about multiplayer in release notes
    Have you tried to run two standalone versions and not using Editor? x64?
     
  6. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    ok i can repro this with a 5.1 build. Only in 2 stand-alone players. This does not happen in 5.2...
     
  7. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Could you give any estimates when it is going to be fixed? I was preparing to release in August and unfortunately 5.2 cannot be used for production yet. Not in the current state.
     
  8. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    the fix has been submitted for 5.1, it will be in an upcoming 5.1 patch release.

    This will be in 5.1.3p1
     
    Last edited: Aug 13, 2015
    montyfi likes this.
  9. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    It DOES happen in 5.2.0f3
    Just installed it, compiled and run two standalone executable side by side:
    - Host can see the ball (scene object)
    - Client cannot see the ball until ball position is changed by host/client

    It surprises me a lot. No one using scene objects? Not even unity testers?
    Maybe networking examples/functions were changed in 5.2 and I'm doing it wrong?