Search Issue Tracker

Fixed in 2022.2.X

Fixed in 2021.2.X, 2022.1.X

Votes

0

Found in

2021.2.11f1

2022.1.0b7

2022.2.0a4

Issue ID

1399997

Regression

Yes

Clicking scale constraint button on 2D object doesn't apply constraint and throws NullReferenceException

2D

-

How to reproduce:
1. Create a new project
2. Create any 2D object (e. g. Image)
3. Click Scale constraint button on Rect Transform

Expected result: Constraint is set and no error is thrown
Actual result: Constraint is not set and NullReferenceException is thrown

Reproducible with: 2021.2.11f1, 2022.1.0b7
Not reproducible with: 2021.2.10f1, 2022.1.0b6
Couldn't test with: 2020.3.27f1 (no such feature)

Full error: NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorGUI.LinkedVector3Field (UnityEngine.Rect position, UnityEngine.GUIContent label, UnityEngine.GUIContent toggleContent, UnityEngine.Vector3 value, System.Boolean& proportionalScale, UnityEngine.Vector3 initialScale, System.UInt32 mixedValues, System.Int32& axisModified, UnityEditor.SerializedProperty property, UnityEditor.SerializedProperty proportionalScaleProperty) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:4429)
UnityEditor.ConstrainProportionsTransformScale.DoGUI (UnityEngine.Rect rect, UnityEngine.GUIContent scaleContent, UnityEngine.Vector3 value, UnityEngine.Object[] targetObjects, System.Int32& axisModified, UnityEditor.SerializedProperty property, UnityEditor.SerializedProperty constrainProportionsProperty) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/ConstrainProportionsTransformScale.cs:28)
UnityEditor.RectTransformEditor.OnInspectorGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/RectTransformEditor.cs:303)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Inspector/InspectorElement.cs:636)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.