Search Unity

Resolved How to Synchronize Ghost Structural Changes?

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by Kmsxkuse, Dec 8, 2022.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    As mentioned in an earlier question, structural changes to ghosts are not replicated to clients. Should I be using RPCs from server to client to trigger relevant structural change systems?
     
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    314
    It's best practice to entirely avoid structural changes of Ghosts. Prefer to make the components `IEnableableComponents`, and toggle those, to get the same kind of behaviour.

    RPCs should not be used for this kind of gameplay logic, because:
    • They cannot be predicted.
    • They do not replicate state to new clients (e.g. Using an RPC to open a chest will not be replicated to any new joiners).
    • They do not work with ghost subsystems (like importance and relevancy).
     
    Kmsxkuse likes this.