InvalidOperationException with Configurable Joint

I am trying to use a Configurable Joint to constrain movement around the Z axis and have it configured exactly as per the 2D Gameplay Tutorial.pdf:

XMotion - Free
YMotion - Free
ZMotion - Locked
Angular XMotion - Locked
Angular YMotion - Locked
Angular ZMotion - Free
Configured in World Space - enabled

When I first run the game in Unity, it shows the following exception in the Console Log:

InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Peek ()
UnityEngine.GUIClip.Unclip (Vector2 pos)
UnityEngine.GUIUtility.GUIToScreenPoint (Vector2 guiPoint)
UnityEditor.EditorUtility.DisplayCustomMenu (Rect position, System.String[ ] options, System.Boolean[ ] enabled, System.Int32[ ] selected, UnityEditor.SelectMenuItemFunction callback, System.Object userData) [0x00000] (at /Users/build/builds/unity-trunk/unity/Editor/Mono/Generated/Utility.cs:233)
UnityEditor.PaneMenu.DropDown (Rect position) (at /Users/build/builds/unity-trunk/unity/Editor/Mono/GUI/DockArea.cs:994)
UnityEditor.BaseProjectWindow.HierarchyView () (at /Users/build/builds/unity-trunk/unity/Editor/Mono/ProjectWindow/ProjectWindow.cs:647)
UnityEditor.BaseProjectWindow.OnGUI () (at /Users/build/builds/unity-trunk/unity/Editor/Mono/ProjectWindow/ProjectWindow.cs:311)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) [0x00000]

Also attached to my prefab object is a Rigibody and an Animation Component (though I have no animation setup). The RigiBody is set with the following:

Mass 1
Drag 0.5
Angular Drag 0.05
Use Gravity - true
Is Kinematic - false
Interpolate - none
Freeze rotation - false

The code does work and the prefab object behaves exactly as I expect, but it is throwing this exception that has me concerned.

Thanks

Looks like it’s just an editor GUI bug, and it’s probably completely unrelated to your ConfigureableJoint. Does it go away if you restart the editor?

Well… would you believe it.

I closed the project and Unity, restarted and the error is gone.

I guess i’ve learned a new Unity skill… the Ctrl-Alt-Del equivalent :slight_smile:

Thanks for that.
Steddy