Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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:
    331
    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.