Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug Received a ghost from the server which has a different hash on the client

Discussion in 'NetCode for ECS' started by vitaliizobrov, Feb 1, 2024.

  1. vitaliizobrov

    vitaliizobrov

    Joined:
    Sep 20, 2022
    Posts:
    2
    Received a ghost - test - from the server which has a different hash on the client (got 5048038340241073675 but expected 12270802493561336413). GhostPrefab: Unity.Entities.Entity ('test').

    Solved
     
    Last edited: Feb 1, 2024
  2. te_headfirst

    te_headfirst

    Joined:
    Aug 1, 2023
    Posts:
    18
    I have a test project where I have setup that I can connect direct or via relay server. I get a list the errors you posted when connecting directly but not when connecting over relay, but cannot see that there should be any difference in my code between the two.

    What was the cause of the problem for you? and how did you solve it? :)
     
  3. te_headfirst

    te_headfirst

    Joined:
    Aug 1, 2023
    Posts:
    18
    Turns out that if the client connects before the subscene is completely loaded, some of the programmatically added ghost prefabs was not ready.

    While I did not find a way yet to specifically ask the "GhostCollectionPrefab" for when it is fully loaded, I added a require for update on some of the prefabs and apparently this is good enough.

    I created another post on this https://forum.unity.com/threads/the...ot-have-a-valid-prefab-on-the-client.1544759/