{"record":{"id":"5a1c835ba877b0f6","repo":"Unity-Technologies/UnityCsReference","slug":"globalobjectid-getglobalobjectidslow-int-out","errorCode":null,"errorMessage":"GlobalObjectId.GetGlobalObjectIdSlow(int[], [Out] GlobalObjectId[]) is obsolete. Use GlobalObjectId.GetGlobalObjectIdSlow(EntityId[], [Out] GlobalObjectId[]).","messagePattern":"GlobalObjectId\\.GetGlobalObjectIdSlow\\(int\\[\\], \\[Out\\] GlobalObjectId\\[\\]\\) is obsolete\\. Use GlobalObjectId\\.GetGlobalObjectIdSlow\\(EntityId\\[\\], \\[Out\\] GlobalObjectId\\[\\]\\)\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"Editor/Mono/GlobalObjectId.bindings.cs","lineNumber":48,"sourceCode":"        // Converts an Object reference to a global unique ID\n        [FreeFunction]\n        extern public static GlobalObjectId GetGlobalObjectIdSlow(UnityEngine.Object targetObject);\n\n        [FreeFunction]\n        extern public static void GetGlobalObjectIdsSlow(UnityEngine.Object[] objects, [Out] GlobalObjectId[] outputIdentifiers);\n\n        [Obsolete(\"GlobalObjectId.GetGlobalObjectIdSlow(int) is obsolete. Use GlobalObjectId.GetGlobalObjectIdSlow(EntityId) instead.\", true)]\n        public static GlobalObjectId GetGlobalObjectIdSlow(int instanceId)\n        {\n            return GetGlobalObjectIdSlow((EntityId)instanceId);\n        }\n\n        [Obsolete(\n            \"GlobalObjectId.GetGlobalObjectIdSlow(int[], [Out] GlobalObjectId[]) is obsolete. Use GlobalObjectId.GetGlobalObjectIdSlow(EntityId[], [Out] GlobalObjectId[]) is obsolete instead.\",\n            true)]\n        public static void GetGlobalObjectIdsSlow(int[] instanceIds, [Out] GlobalObjectId[] outputIdentifiers)\n        {\n            throw new InvalidOperationException(\n                \"GlobalObjectId.GetGlobalObjectIdSlow(int[], [Out] GlobalObjectId[]) is obsolete. Use GlobalObjectId.GetGlobalObjectIdSlow(EntityId[], [Out] GlobalObjectId[]).\");\n        }\n\n        // Converts an Object reference to a global unique ID\n        public static GlobalObjectId GetGlobalObjectIdSlow(EntityId entityid)\n        {\n            return GetGlobalObjectIdFromInstanceIdSlow(entityid);\n        }\n\n        public static void GetGlobalObjectIdsSlow(EntityId[] entityIds, [Out] GlobalObjectId[] outputIdentifiers)\n        {\n            GetGlobalObjectIdsFromInstanceIdsSlow(entityIds, outputIdentifiers);\n        }\n\n        // Converts an Object reference to a global unique ID\n        [FreeFunction]\n        extern static GlobalObjectId GetGlobalObjectIdFromInstanceIdSlow(EntityId instanceId);\n","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/GlobalObjectId.bindings.cs#L30-L66","documentation":"GetGlobalObjectIdsSlow(int[], GlobalObjectId[]) is marked [Obsolete(..., true)] (treat-as-error) and its body throws InvalidOperationException directing callers to the EntityId[] overload. This is part of the instance-id-to-EntityId migration: int instance IDs are being phased out in favor of the strongly-typed EntityId.","triggerScenarios":"Calling GlobalObjectId.GetGlobalObjectIdsSlow with an int[] (legacy instance IDs); compiling code written against an older Unity API; a library that has not migrated to EntityId.","commonSituations":"Upgrading Unity across the instance-id->EntityId boundary; third-party package built pre-migration; auto-upgrade tooling that left int[] calls intact.","solutions":["Replace int[] instanceIds with EntityId[] and call GetGlobalObjectIdsSlow(EntityId[], GlobalObjectId[]).","If you hold raw ints, convert via (EntityId)instanceId at the call site or upstream.","Update dependent packages to versions that target the new API."],"exampleFix":"// before\nint[] ids = ...;\nGlobalObjectId.GetGlobalObjectIdsSlow(ids, output);\n\n// after\nEntityId[] ids = ...; // or ids.Select(i => (EntityId)i).ToArray()\nGlobalObjectId.GetGlobalObjectIdsSlow(ids, output);","handlingStrategy":"type-guard","validationCode":"// migrate ints to EntityIds before the call\nEntityId[] eids = Array.ConvertAll(instanceIds, i => (EntityId)i);\nGlobalObjectId.GetGlobalObjectIdsSlow(eids, outputIdentifiers);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate storage from int instance IDs to EntityId.","Compile with obsolete-as-error to catch legacy calls early.","Update dependent packages to EntityId-aware versions."],"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"}