{"record":{"id":"74656e14a1a1d2c9","repo":"Unity-Technologies/UnityCsReference","slug":"recursive-setlivepropertyoverrides-are-not-allowed","errorCode":null,"errorMessage":"Recursive SetLivePropertyOverrides are not allowed.","messagePattern":"Recursive SetLivePropertyOverrides are not allowed\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/InspectorUtility.cs","lineNumber":141,"sourceCode":"                {\n                    livePropertyFeatureEnabled = true;\n                }\n            }\n            finally\n            {\n                // This serialized object is just a temp reference to pass around, it doesn't own the pointer\n                s_CachedSerializedObject.m_NativeObjectPtr = IntPtr.Zero;\n            }\n\n            return livePropertyFeatureEnabled;\n        }\n\n        // Invoke override callback for live property.\n        [RequiredByNativeCode]\n        internal static void Internal_CallPropertyOverrideCallback(IntPtr nativeObjectPtr, bool isLiveUpdate)\n        {\n            if (s_CachedSerializedObject.m_NativeObjectPtr != IntPtr.Zero && s_CachedSerializedObject.m_NativeObjectPtr != nativeObjectPtr)\n                throw new ArgumentException(\"Recursive SetLivePropertyOverrides are not allowed.\");\n\n            try\n            {\n                if (s_CachedSerializedObject.m_NativeObjectPtr == IntPtr.Zero)\n                {\n                    s_CachedSerializedObject.m_NativeObjectPtr = nativeObjectPtr;\n                    if (s_CachedSerializedObject.targetObject == null)\n                        return;\n                }\n\n                var targetType = s_CachedSerializedObject.targetObject.GetType();\n                if (s_LivePropertyOverrideCallbacks.TryGetValue(targetType, out var cb))\n                {\n                    cb.Invoke(s_CachedSerializedObject, isLiveUpdate);\n                }\n            }\n            finally\n            {","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/InspectorUtility.cs#L123-L159","documentation":"Thrown by Internal_CallPropertyOverrideCallback when the cached serialized object's native pointer is already set to a different pointer, indicating SetLivePropertyOverrides was re-entered for a different object. The override callback path is not re-entrant across different targets.","triggerScenarios":"A live-property override callback for object A triggers property override invocation for object B while s_CachedSerializedObject still references A's native pointer. Re-entrant property overrides during a live update.","commonSituations":"Custom inspector logic that touches another object's properties from within a live-property override. Native callbacks firing for a second object while the first override is still executing.","solutions":["Do not invoke property overrides on other objects from inside an override callback.","Keep override callbacks self-contained to the current target object.","Queue cross-object work via EditorApplication.delayCall to run after the callback unwinds."],"exampleFix":"// before\n// inside override callback for target A:\nApplyToTarget(B); // triggers override for B -> throws\n\n// after\nEditorApplication.delayCall += () => ApplyToTarget(B);","handlingStrategy":"try-catch","validationCode":"// Not directly callable; guard by keeping override callbacks scoped to the current target.","typeGuard":null,"tryCatchPattern":"try { /* cross-target work in callback */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Recursive\"))\n{ EditorApplication.delayCall += () => ApplyToTarget(B); }","preventionTips":["Keep override callbacks self-contained.","Queue cross-object work via delayCall."],"tags":["unity","editor","live-properties","recursion","serialized-object"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}