Search Unity

Resolved How to sync changes in NetworkObject for all players

Discussion in 'Netcode for GameObjects' started by alex94123, Dec 14, 2022.

  1. alex94123

    alex94123

    Joined:
    May 26, 2020
    Posts:
    11
    Hi, so if I spawn a NetworkObject it gets synced for all players, but if I then change something, like a mesh, it only happens locally. So my question is how do i sync these changes across the network?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,975
    That is what you use RPC messages for. You could also use a NetworkVariable that encodes an enum which indicates the mesh currently in use.
     
  3. alex94123

    alex94123

    Joined:
    May 26, 2020
    Posts:
    11
    thank you