{"record":{"id":"4df5de37bdc97108","repo":"Unity-Technologies/UnityCsReference","slug":"use-drawoutline-entityid-color-float-instead","errorCode":null,"errorMessage":"Use DrawOutline(EntityId[], Color, float) instead.","messagePattern":"Use DrawOutline\\(EntityId\\[\\], Color, float\\) instead\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Handles/Handles.cs","lineNumber":1556,"sourceCode":"        {\n            return PlayModeView.GetMainPlayModeViewTargetSize();\n        }\n\n        [Obsolete(\"Deprecated. Use DrawOutline(EntityId[], EntityId[], Color, Color, float) instead.\",true)]\n        public static void DrawOutline(int[] parentRenderers, int[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n            => throw new InvalidOperationException(\n                \"Use DrawOutline(EntityId[], EntityId[], Color, Color, float) instead.\");\n        public static void DrawOutline(EntityId[] parentRenderers, EntityId[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n        {\n            if(Event.current.type != EventType.Repaint)\n                return;\n            Internal_DrawOutline(parentNodeColor, childNodeColor, EntityId.None, parentRenderers, childRenderers, OutlineDrawMode.SelectionOutline, fillOpacity, fillOpacity);\n            Internal_FinishDrawingCamera(Camera.current, true);\n        }\n\n        [Obsolete(\"Deprecated. Use DrawOutline(EntityId[], Color, float) instead.\", true)]\n        public static void DrawOutline(int[] renderers, Color color, float fillOpacity = 0) =>\n            throw new InvalidOperationException(\n                \"Use DrawOutline(EntityId[], Color, float) instead.\");\n        public static void DrawOutline(EntityId[] renderers, Color color, float fillOpacity = 0) =>\n            DrawOutline(renderers, null, color, color, fillOpacity);\n\n        public static void DrawOutline(Renderer[] renderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n        {\n            EntityId[] parentRenderers, childRenderers;\n            HandleUtility.FilterRendererIDs(renderers, out parentRenderers, out childRenderers);\n            DrawOutline(parentRenderers, childRenderers, parentNodeColor, childNodeColor, fillOpacity);\n        }\n\n        public static void DrawOutline(Renderer[] renderers, Color color, float fillOpacity = 0) =>\n            DrawOutline(renderers, color, color, fillOpacity);\n\n        public static void DrawOutline(GameObject[] objects, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n        {\n            EntityId[] parentRenderers, childRenderers;\n            HandleUtility.FilterEntityIds(objects, out parentRenderers, out childRenderers, out _);","sourceCodeStart":1538,"sourceCodeEnd":1574,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Handles/Handles.cs#L1538-L1574","documentation":"The single-array DrawOutline overload accepting int[] (instance IDs) is marked [Obsolete(..., true)] and always throws InvalidOperationException. The replacement overload takes EntityId[] and is the only way to draw a single-group outline.","triggerScenarios":"Calling Handles.DrawOutline(int[], Color, float) from source code (compile error) or via reflection (runtime throw).","commonSituations":"Existing editor code or third-party packages that draw selection outlines from instance ID arrays after a Unity version upgrade.","solutions":["Convert int[] to EntityId[] and call DrawOutline(EntityId[], Color, float).","Alternatively, pass Renderer[] directly to the Renderer[]-based overload."],"exampleFix":"// before\nHandles.DrawOutline(rendererIds, color, 0.5f);\n// after\nEntityId[] entityIds = Array.ConvertAll(rendererIds, id => (EntityId)id);\nHandles.DrawOutline(entityIds, color, 0.5f);","handlingStrategy":"validation","validationCode":"// The [Obsolete(true)] attribute makes this a compile-time error.\n// Replace the int[] overload with the EntityId[] overload:\nEntityId[] entityIds = Array.ConvertAll(intIds, id => (EntityId)id);\nHandles.DrawOutline(entityIds, color, fillOpacity);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After Unity upgrades, grep for DrawOutline calls with a single int[] argument and migrate to EntityId[].","Prefer the Renderer[] overload for convenience when you have Renderer references."],"tags":["obsolete","api-migration","selection-outline","entity-id","unity-editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}