Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2019.4.X, 2020.3.X, 2021.1.X
[Cloth] [Undo] Errors thrown on performing 'Undo' functionality after changing properties from 'Cloth Constraints' window
After adding a cloth component in 3d Object, On editing and undoing the 'Cloth Constraints' or 'Cloth self/ Inter collision' window's properties causes 'MissingReferenceException' error thrown in the console.
Step to Reproduce:
1. Create a New project
2. Hierarchy > 3D Object > Cube
3. Cube > Add Component > Cloth > Edit Cloth Constraint.
4. Change Constraint Property.
5. Edit > Click 'Undo Selection Change' twice.
Use the shortcut key to perform Undo.
'MissingReferenceException' error thrown in the console.
No error should be thrown in the console and undo functionality performs gracefully.
2021.1.0a2, 2020.2.0b10, 2020.1.12f1, 2020.1.b1
Working fine on:
Note: Unable to check on 2021.1.0a3 because of this bug ID 
MissingReferenceException: The object of type 'Cloth' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.ClothInspector.IsConstrained () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:1776)
UnityEditor.ClothInspector.ConstraintEditing (UnityEngine.Object unused, UnityEditor.SceneView sceneView) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:1859)
UnityEditor.SceneViewOverlay.WindowTrampoline (System.Int32 id) (at /Users/bokken/buildslave/unity/build/Editor/Mono/SceneView/SceneViewOverlay.cs:110)
UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:444)
UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUI.cs:1767)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:428)
Occurring on Windows 10 & macOS 10.15
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- All models become suddenly stuck in weird poses and Animations are messed up when previewing any character animation in the Editor and looking around in the Scene View
- Files are not included in the “Assembly-CSharp.csproj” file when they are in the Editor folder
- [URP] Specular Color behavior does not match Legacy or HDRP
- [Linux] Array Element doesn't duplicate/delete when clicking "Duplicate/Delete Array Element" on an Array Element in a Prefab GameObject
- [ShaderGraph] Skewed guidelines are drawn from the top left corner of the Node when it is moved