Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug NetworkObject GlobalObjectIdHash changes when in prefab isolation mode

Discussion in 'Netcode for GameObjects' started by Yoraiz0r, Aug 3, 2023.

  1. Yoraiz0r


    Apr 26, 2015
    I recently started using Netcode for Gameobjects, and noticed that I ended up with 2 prefabs that have the same hash.

    After some investigation, I found that the hash gets corrupt if you use prefab isolation mode to edit the prefabs.

    Specifically, GlobalObjecIdHash is just hashing the value of
    var globalObjectIdString = UnityEditor.GlobalObjectId.GetGlobalObjectIdSlow(this).ToString();

    But this method is returning the same value for any object in prefab isolation mode.
    Specifically, it always returns

    I have two prefabs that somehow ended up serializing these values instead of their in-project-view values.

    What can be done to avoid this? I am using NGO 1.5.1 and Unity 2023.1.3f1