diff --git a/Packages/src/Editor/Utils/RaycastGridAnnotator.cs b/Packages/src/Editor/Utils/RaycastGridAnnotator.cs index 8a2065957..2df690c24 100644 --- a/Packages/src/Editor/Utils/RaycastGridAnnotator.cs +++ b/Packages/src/Editor/Utils/RaycastGridAnnotator.cs @@ -373,7 +373,12 @@ internal static int CreateClusterKey(Collider collider) Debug.Assert(collider != null, "Collider is required for raycast clustering."); // A placement area can use several colliders on one object; one annotation should describe the clickable object. +#if UNITY_6000_4_OR_NEWER + // GetInstanceID is obsolete-as-error on Unity 6000.4+; the lower 32 bits of EntityId equal the legacy instance id. + return (int)EntityId.ToULong(collider!.gameObject.GetEntityId()); +#else return collider!.gameObject.GetInstanceID(); +#endif } private static RaycastClusterSample CreateClusterSample(