{"record":{"id":"c27b2efc3b83bc69","repo":"Unity-Technologies/UnityCsReference","slug":"globalobjectidentifierstoinstanceidsslow-is-obsole","errorCode":null,"errorMessage":"GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.","messagePattern":"GlobalObjectIdentifiersToInstanceIDsSlow is obsolete\\. Use GlobalObjectIdentifiersToEntityIdsSlow instead\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"warning","filePath":"Editor/Mono/GlobalObjectId.bindings.cs","lineNumber":134,"sourceCode":"\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":116,"sourceCodeEnd":144,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/GlobalObjectId.bindings.cs#L116-L144","documentation":"GlobalObjectIdentifiersToInstanceIDsSlow(GlobalObjectId[], int[]) is the batch reverse-lookup overload marked [Obsolete(..., true)]; it throws NotImplementedException pointing to GlobalObjectIdentifiersToEntityIdsSlow which writes EntityId[] instead of int[]. The migration removes int instance IDs from the batch path too.","triggerScenarios":"Calling the batch reverse-lookup with an int[] output buffer; legacy code resolving many GlobalObjectIds to instance IDs at once; plugins predating the EntityId API.","commonSituations":"Unity version upgrade across the EntityId boundary; performance-sensitive batch code still on ints; third-party package not yet migrated.","solutions":["Switch to GlobalObjectIdentifiersToEntityIdsSlow(ids, outputEntityIds) with an EntityId[] buffer.","Allocate the output buffer as EntityId[] sized to the input length.","Update dependent libraries to EntityId-aware versions."],"exampleFix":"// before\nint[] instanceIds = new int[guids.Length];\nGlobalObjectId.GlobalObjectIdentifiersToInstanceIDsSlow(guids, instanceIds);\n\n// after\nEntityId[] entityIds = new EntityId[guids.Length];\nGlobalObjectId.GlobalObjectIdentifiersToEntityIdsSlow(guids, entityIds);","handlingStrategy":"type-guard","validationCode":"EntityId[] entityIds = new EntityId[identifiers.Length];\nGlobalObjectId.GlobalObjectIdentifiersToEntityIdsSlow(identifiers, entityIds);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Allocate EntityId[] output buffers for the batch reverse-lookup.","Migrate batch code from int[] to EntityId[].","Keep third-party packages updated across the EntityId migration."],"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"}