- Home /
Mecanim:Rig:Configure >> NullReferenceError
Trying Mecanim for the first time. I'm trying to map the bones for a model. I named all the bones as they are named in the Mapping tab of the inspector for the configure process of the rigging.
Upon entering the configure mode, there is immediately a null reference exception:
 NullReferenceException
 UnityEngine.Transform.get_position () (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:19)
 UnityEditor.Handles.DoBoneHandle (UnityEngine.Transform target, System.Collections.Generic.Dictionary`2 validBones) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/EditorHandles/BoneHandle.cs:43)
 UnityEditor.AvatarSkeletonDrawer.DrawSkeletonSubTree (System.Collections.Generic.Dictionary`2 actualBones, .BoneWrapper[] bones, Quaternion orientation, UnityEngine.Transform tr, Bounds bounds) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarSkeletonDrawer.cs:123)
 UnityEditor.AvatarSkeletonDrawer.DrawSkeleton (UnityEngine.Transform reference, System.Collections.Generic.Dictionary`2 actualBones, .BoneWrapper[] bones) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarSkeletonDrawer.cs:56)
 UnityEditor.AvatarMappingEditor.OnSceneGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarMappingEditor.cs:745)
 UnityEditor.AvatarEditor.OnSceneGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarEditor.cs:402)
 System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
 Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
 System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
 System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
 UnityEditor.SceneView.CallOnSceneGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/SceneView/SceneView.cs:1335)
 UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/SceneView/SceneView.cs:839)
 UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/SceneView/SceneView.cs:728)
 System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
I can save my mapping as a .ht file. After I click APPLY the mapping becomes blank with the null reference error again. If I click DONE then Unity crashes. If I restart Unity and try to load my mapping I get the following error:
 NullReferenceException
     UnityEngine.Transform.get_position () (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:19)
     UnityEditor.Handles.DoBoneHandle (UnityEngine.Transform target, System.Collections.Generic.Dictionary`2 validBones) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/EditorHandles/BoneHandle.cs:43)
     UnityEditor.AvatarSkeletonDrawer.DrawSkeletonSubTree (System.Collections.Generic.Dictionary`2 actualBones, .BoneWrapper[] bones, Quaternion orientation, UnityEngine.Transform tr, Bounds bounds) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarSkeletonDrawer.cs:123)
     UnityEditor.AvatarSkeletonDrawer.DrawSkeleton (UnityEngine.Transform reference, System.Collections.Generic.Dictionary`2 actualBones, .BoneWrapper[] bones) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarSkeletonDrawer.cs:56)
     UnityEditor.AvatarMappingEditor.OnSceneGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarMappingEditor.cs:745)
And also this error:
 InvalidOperationException: Operation is not valid due to the current state of the object
 System.Linq.Enumerable.First[Transform] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
 System.Linq.Enumerable.First[Transform] (IEnumerable`1 source, System.Func`2 predicate)
 UnityEditor.AvatarMappingEditor.ApplyTemplate () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/Avatar/AvatarMappingEditor.cs:702)
 UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/BuildAgent/work/812c4f5049264fad/Editor/MonoGenerated/Editor/GenericMenu.cs:83)
Is anybody familiar with this error and if someone knows how to overcome it may I know how you overcame this? Thankyou.
I can do all the animation via fbx animations but it would be nice to use Mecanim as I can see how it will save me a lot of time.
Any advice would be very much appreciated. Thanks for taking the time to read my question.
I second that, I have the same problem, and this question was asked several times with no answer... does no-one know a thing about this?
Your answer
 
 
             Follow this Question
Related Questions
Mecanim distorts 3D model 0 Answers
rigging in blender for mecanim 1 Answer
How Do I Create Mecanim Animations? 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                