Copyright © 2026 Unity Technologies
Steps to reproduce:
1. Create new Unity project using Universal 3D Template
2. In Hierarchy window create Empty GameObject and select it
3. In Inspector window add UI Document and Animation Components
4. Add/create new Source Asset and Panel Settings for UI Document Component
5. Open Animation window
6. Create Animation Clip for GameObject
7. Add Pivot Reference Size Property
8. Enable keyframe recording mode
9. Change value to 22
10. Observe the Console window
Actual results: "NullReferenceException: Object reference not set to an instance of an object" is thrown from PanelComponentInspectorBase.ConfigureFields, along with Error: invalid enum value 22 for type UnityEngine.UIElements.PivotReferenceSize warning. Errors persist after exiting keyframe recording mode and changing the value
Expected results: No errors or exceptions are thrown. The Animation window should display PivotReferenceSize as an enum dropdown to prevent invalid values from being entered, or handle out-of-range integer values gracefully without throwing exceptions
Reproducible with versions: 6000.6.0b1, 6000.6.0b6, 6000.7.0a4
Can’t test with versions: 6000.0.80f1, 6000.3.21f1, 6000.5.6f1, 6000.6.0a7 (UI Authoring not available)
Tested on (OS): Ubuntu 24.04, macOS Tahoe 26.5.2 (M1)
Notes:
Error: invalid enum value 22 for type UnityEngine.UIElements.PivotReferenceSize UnityEditor.RetainedMode:UpdateSchedulers () (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/RetainedMode.cs:68)
NullReferenceException: Object reference not set to an instance of an object UnityEditor.UIElements.Inspector.PanelComponentInspectorBase+<>c__DisplayClass31_0.<ConfigureFields>b__4 (UnityEngine.UIElements.ChangeEvent`1[T] evt) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/GameObjects/Inspector/PanelComponentInspectorBase.cs:145) UnityEngine.UIElements.EventBase`1[T].InvokeCallback (System.Delegate userCallback) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventBase.cs:750) UnityEngine.UIElements.EventNoArgValue.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventCallbackInternal c) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallback.cs:149) UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, UnityEngine.UIElements.EventCallbackRegistry registry) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallbackRegistry.cs:379) UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPath (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:212) UnityEngine.UIElements.EventDispatchUtilities.DefaultDispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:558) UnityEngine.UIElements.EventBase.Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventBase.cs:152) UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:420) UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:216) UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Panel.cs:780)
Issues you vote on will appear here