Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug [1.0.8] TransformDefaultVariant has different hash between develop and release version

Discussion in 'NetCode for ECS' started by hxhloveunity, Aug 29, 2023.

  1. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    29
    we convert ghost by GhostPrefabCreation.ConvertToGhostPrefab,but in release runtime,ghost do not send LocalTransform,because DefaultVariantSystemBase.Rule.TryGetHashElseZero use ComponentType.GetDebugTypeName to calculate hash:
    1. in release it null
    2. in develop it has value
    so in release version,hash will different with TransformDefaultVariantGhostComponentSerializer.s_State.VariantHash
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    762
    The GhostPrefabCreation.ConvertToGhostPrefab should be called after the
    GhostComponentSerializerCollectionData has been initialised (so that all the variants has been registered).

    We fixed that recently but the fix has not been released yet. In order to work around this (and be sure that everything is properly initialised) the safest is to create these prefabs in the first update of a system instead inside the oncreate.

    There was also another problem with the Variant hash calculation (again fixed but not yet released) that may affect that.

    All these will be available soon in the next Entities 1.1 release.
     
  3. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    29
    yes, we convert ghost in OnUpdate,but different hash make TransformDefaultVariant DefaultType is NotDefault
    instead of YesAsIsUserSpecifiedNewDefault