- Home /
Spammed with a Null Reference exception in Animator
I don't know how to track down what asset is missing... this is an editor error, not an in-game issue.
Works fine in-game.
However, my game started taking 20-50 seconds to load after this error began:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext.BuildNames () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/TransitionEditionContext.cs:44)
UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext..ctor (UnityEditor.Animations.AnimatorTransitionBase aTransition, UnityEditor.Animations.AnimatorState aSourceState, UnityEditor.Animations.AnimatorStateMachine aSourceStateMachine, UnityEditor.Animations.AnimatorStateMachine aOwnerStateMachine) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/TransitionEditionContext.cs:28)
UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.ComputeTransitionContexts () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorTransitionInspectorBase.cs:125)
UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorTransitionInspectorBase.cs:87)
UnityEditor.Graphs.AnimationStateMachine.AnimatorStateTransitionInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorStateTransitionInspector.cs:55)
If the game load time didn't dramatically slow down at the same time these errors started, I would agree!
I have the same problem. It popped up when I started trying to manually play animations in my animator controller via scripting. I have no idea what's causing it.
I have same problem too, it's a rare case, but showing the animator tab looks like solving the problem, and when I relaunch Unity, this error never popping again.
Answer by mezcalito · Apr 05, 2015 at 02:09 PM
it also happened to me when I was adding extra animation states and then I removed them, just followed Wildan suggestion to close Unity and reopen it again and that fixed it for me
Answer by eweeparker · Jun 10, 2015 at 08:49 AM
Actually I noticed that when changing my "has exit time" checkbox in an animation state, my FindGameObjectWithTag("Player") script references will no longer work. You have to restart it to recompile everything correctly. An interesting situation since everything works fine otherwise. I just wonder if you were altering animation states when this happened.
Answer by turkiyecng · Aug 25, 2015 at 02:51 PM
I got same error . But i fixed that deleting all meta files in assets folder/subfolder inside. If unity running close unity and after delete (meta files). Its must work .
Answer by Vivek-Savsaiya · Mar 21, 2015 at 06:50 PM
NullReferenceException means the object referenced doesn't exist. It's not exclusive to scripting. If you deleted the actual animation file from your object you'll have to reload the object.
or
in my case I copied a gameobject whose have a animator Controller, for solving I just again assigned a controller in animator(inspector), thats resolve my error. hope this will help you
Your answer
![](https://koobas.hobune.stream/wayback/20220613185936im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scale animation with model 1 Answer
Character legs/knees twisting inside in animation 1 Answer
Can you change AnimationClip in controller via scripting? 0 Answers
Gettings Animations in LocalSpace (Parenting Not Working) 0 Answers
if i use capsule collider with one of the bone instead of full character. will there be any problem 0 Answers