{"record":{"id":"7be52c771a2cecf6","repo":"Unity-Technologies/UnityCsReference","slug":"globalobjectidentifiertoinstanceidslow-is-obsolete","errorCode":null,"errorMessage":"GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.","messagePattern":"GlobalObjectIdentifierToInstanceIDSlow is obsolete\\. Use GlobalObjectIdentifierToEntityIdSlow instead\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"warning","filePath":"Editor/Mono/GlobalObjectId.bindings.cs","lineNumber":129,"sourceCode":"                TargetPrefab = targetPrefab\n            };\n\n            return true;\n        }\n\n        // Converting one object at a time is incredibly slow. (Have to iterate whole scene to grab one object...)\n        // Always prefer using batch API when multiple objects need to be looked up.\n        [FreeFunction]\n        extern public static UnityEngine.Object GlobalObjectIdentifierToObjectSlow(GlobalObjectId id);\n        [FreeFunction]\n        extern public static void GlobalObjectIdentifiersToObjectsSlow(GlobalObjectId[] identifiers, [Out] UnityEngine.Object[] outputObjects);\n\n        // Converting one object at a time is incredibly slow. (Have to iterate whole scene to grab one object...)\n        // Always prefer using batch API when multiple objects need to be looked up.\n        [Obsolete(\"GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.\", true)]\n        public static int GlobalObjectIdentifierToInstanceIDSlow(GlobalObjectId id)\n        {\n            throw new System.NotImplementedException(\"GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.\");\n        }\n        [Obsolete(\"GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.\", true)]\n        public static void GlobalObjectIdentifiersToInstanceIDsSlow(GlobalObjectId[] identifiers, [Out] int[] outputInstanceIDs)\n        {\n            throw new System.NotImplementedException(\"GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.\");\n        }\n\n        [FreeFunction]\n        extern public static EntityId GlobalObjectIdentifierToEntityIdSlow(GlobalObjectId id);\n        [FreeFunction]\n        extern public static void GlobalObjectIdentifiersToEntityIdsSlow(GlobalObjectId[] identifiers, [Out] EntityId[] outputEntityIds);\n\n    }\n}\n","sourceCodeStart":111,"sourceCodeEnd":144,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/GlobalObjectId.bindings.cs#L111-L144","documentation":"GlobalObjectIdentifierToInstanceIDSlow(GlobalObjectId) is [Obsolete(..., true)] and throws NotImplementedException because the int-instance-ID return concept is being removed in favor of EntityId. The message directs callers to GlobalObjectIdentifierToEntityIdSlow, which returns the strongly-typed EntityId.","triggerScenarios":"Calling the single-id reverse-lookup that returns an int instance ID; legacy code resolving a GlobalObjectId back to an instance ID; plugins not yet migrated.","commonSituations":"Cross-version Unity upgrade crossing the EntityId migration; copied legacy sample code; tooling that stored GlobalObjectIds and reverse-resolved to ints.","solutions":["Replace the call with GlobalObjectIdentifierToEntityIdSlow(id) and consume the EntityId.","If a raw int is unavoidable downstream, convert the EntityId explicitly at the boundary.","Migrate storage from int instance IDs to EntityId."],"exampleFix":"// before\nint instanceId = GlobalObjectId.GlobalObjectIdentifierToInstanceIDSlow(gid);\n\n// after\nEntityId entityId = GlobalObjectId.GlobalObjectIdentifierToEntityIdSlow(gid);","handlingStrategy":"type-guard","validationCode":"EntityId entityId = GlobalObjectId.GlobalObjectIdentifierToEntityIdSlow(id);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the EntityId-returning reverse-lookup overload.","Migrate code that expects int instance IDs.","Enable obsolete-as-error during upgrades."],"tags":["globalobjectid","obsolete","migration","entityid","editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}