{"record":{"id":"28fecd353feaced7","repo":"Unity-Technologies/UnityCsReference","slug":"get-getpickingincludeexcludelist-is-obsolete-use","errorCode":null,"errorMessage":"Get GetPickingIncludeExcludeList is obsolete, use GetPickingIncludeExcludeEntityIdList instead.","messagePattern":"Get GetPickingIncludeExcludeList is obsolete, use GetPickingIncludeExcludeEntityIdList instead\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Handles/HandleUtility.cs","lineNumber":1232,"sourceCode":"            return new PickingIncludeExcludeEntityIdList(s_RendererIncludeBuffer, s_RendererExcludeBuffer, s_EntityIncludeBuffer, s_EntityExcludeBuffer, allocator);\n        }\n\n        public static PickingIncludeExcludeEntityIdList GetSelectionOutlineIncludeExcludeEntityIdList(Allocator allocator = Allocator.Persistent)\n        {\n            s_RendererIncludeBuffer.Clear();\n            s_RendererExcludeBuffer.Clear();\n            s_EntityIncludeBuffer.Clear();\n            s_EntityExcludeBuffer.Clear();\n            Renderer[] deepSelection = Selection.GetFiltered<Renderer>(SelectionMode.Deep);\n            ExtractRenderersEntityIds(deepSelection, s_RendererIncludeBuffer);\n            ExtractEntities(Selection.objects, s_EntityIncludeBuffer);\n            return new PickingIncludeExcludeEntityIdList(s_RendererIncludeBuffer, null, s_EntityIncludeBuffer, null, allocator);\n        }\n\n        [Obsolete(\"Use GetPickingIncludeExcludeEntityIdList instead. This method will be removed in a future version.\", true)]\n        public static PickingIncludeExcludeList GetPickingIncludeExcludeList(Allocator allocator = Allocator.Persistent)\n        {\n            throw new InvalidOperationException(\"Get GetPickingIncludeExcludeList is obsolete, use GetPickingIncludeExcludeEntityIdList instead.\");\n        }\n\n        [Obsolete(\"Use GetSelectionOutlineIncludeExcludeEntityIdList instead. This method will be removed in a future version.\", true)]\n        public static PickingIncludeExcludeList GetSelectionOutlineIncludeExcludeList(Allocator allocator = Allocator.Persistent)\n        {\n            throw new InvalidOperationException(\"Get GetSelectionOutlineIncludeExcludeList is obsolete, use GetSelectionOutlineIncludeExcludeEntityIdList instead.\");\n        }\n\n        internal static PickingObject PickObject(Vector2 guiPosition,\n            bool selectPrefabRoot = false,\n            List<PickingObject> ignore = null,\n            List<PickingObject> filter = null)\n        {\n            Camera cam = Camera.current;\n            int layers = cam.cullingMask;\n            var screenPosition = GUIPointToScreenPixelCoordinate(guiPosition);\n            var sceneView = SceneView.lastActiveSceneView;\n            bool drawGizmos = sceneView != null && sceneView.drawGizmos;","sourceCodeStart":1214,"sourceCodeEnd":1250,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Handles/HandleUtility.cs#L1214-L1250","documentation":"GetPickingIncludeExcludeList is marked [Obsolete(..., true)] — the 'true' flag makes any direct call a compiler error. The method body also throws InvalidOperationException unconditionally if invoked via reflection. Unity migrated the picking system from int instance IDs to EntityId structs; the replacement is GetPickingIncludeExcludeEntityIdList.","triggerScenarios":"Calling HandleUtility.GetPickingIncludeExcludeList() from source code (caught at compile time) or invoking it dynamically via reflection (throws at runtime).","commonSituations":"Upgrading a Unity project across a version boundary where the picking API changed from int[] to EntityId[]; older editor extensions or third-party packages still reference the old method name.","solutions":["Replace all calls to GetPickingIncludeExcludeList with GetPickingIncludeExcludeEntityIdList, which returns PickingIncludeExcludeEntityIdList.","Update third-party editor packages to versions compatible with the current Unity editor.","If invoking via reflection, remove the reflection path and call the new API directly."],"exampleFix":"// before\nvar list = HandleUtility.GetPickingIncludeExcludeList(Allocator.Persistent);\n// after\nvar list = HandleUtility.GetPickingIncludeExcludeEntityIdList(Allocator.Persistent);","handlingStrategy":"validation","validationCode":"// The [Obsolete(true)] attribute makes this a compile-time error.\n// Grep the codebase and replace:\n//   HandleUtility.GetPickingIncludeExcludeList\n//   -> HandleUtility.GetPickingIncludeExcludeEntityIdList","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Track Unity editor API migration guides after each major version upgrade.","Grep the codebase for deprecated method names (GetPickingIncludeExcludeList) and replace them proactively."],"tags":["obsolete","api-migration","picking","entity-id","unity-editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}