Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to properly sync transforms of gameObject ?

Discussion in 'Multiplayer' started by S_P_S, Sep 12, 2016.

  1. S_P_S

    S_P_S

    Joined:
    Feb 25, 2015
    Posts:
    91
    Hello,

    I have a basic local unity multiplayer game with two players, one of them is the host.
    Both players should be able to transform the position of an environment object, of course both players should see the updated position if the other player changed it.

    In my opinion this should be a pretty basic task, so I created a gameObject with a NetworkIdentity component and a NetworkTransform component. The NetworkIdentity has the box "Local Player Authority" checked.

    When I now play the game the host can change the postion of that object and the client will see the updated position. But when the client changes the position, the host doesn't see the updated position.

    Now my question, whats the proper way to use the NetworkTransform component for both directions (host -> client and client -> host)?

    best regards