Question by
ImLife · Sep 07, 2019 at 10:12 AM ·
animationnullreferenceexceptionargumentexception
AgrumentNullException And NullReferenceException on animating [Video]
So when i am trying to animate a spriterender in unity i get two errors out of nowhere. I do not have any scripts or code in this project. I know i have multiple copies of the character but the problem persits with one aswell.
Looking through the forums i've seen that restarting unity is a solution, but in my case this will not work. I also just updated unity.
Video example: https://youtu.be/8emICGQLxko
ArgumentNullException: Value cannot be null.
Parameter name: sprite
UnityEditor.Experimental.U2D.SpriteEditorExtension.GetSpriteID (UnityEngine.Sprite sprite) (at C:/buildslave/unity/build/Editor/Mono/2D/Common/ScriptBindings/SpriteEditorExtension.bindings.cs:13)
UnityEditor.SpriteEditorWindow.UpdateSelectedSpriteRect (UnityEngine.Sprite sprite) (at C:/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:632)
UnityEditor.SpriteEditorWindow.UpdateSelectedSpriteRectFromSelection () (at C:/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:219)
UnityEditor.SpriteEditorWindow.OnSelectionChange () (at C:/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:201)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.OnSelectionChange () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:199)
NullReferenceException: Object reference not set to an instance of an object
UnityEditorInternal.AnimationWindowUtility.AddKeyframeToCurve (UnityEditorInternal.AnimationWindowCurve curve, System.Object value, System.Type type, UnityEditorInternal.AnimationKeyTime time) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowUtility.cs:257)
UnityEditorInternal.AnimationRecording.AddKey (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.EditorCurveBinding binding, System.Type type, System.Object previousValue, System.Object currentValue) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:514)
UnityEditorInternal.AnimationRecording.ProcessVector3Modification (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.EditorCurveBinding baseBinding, UnityEditor.UndoPropertyModification modification, UnityEngine.Transform target, System.String axis, System.Single scale) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:381)
UnityEditorInternal.AnimationRecording.ProcessVector3Modifications (UnityEditorInternal.IAnimationRecordingState state, System.Collections.Generic.Dictionary`2[System.Object,UnityEditorInternal.AnimationRecording+Vector3Modification]& vector3Modifications) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:402)
UnityEditorInternal.AnimationRecording.Process (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.UndoPropertyModification[] modifications) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:458)
UnityEditorInternal.AnimationWindowControl.ProcessAutoKey (UnityEditor.UndoPropertyModification[] modifications) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:544)
UnityEditorInternal.AnimationWindowControl.PostprocessAnimationRecordingModifications (UnityEditor.UndoPropertyModification[] modifications) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:532)
UnityEditor.Undo.InvokePostprocessModifications (UnityEditor.UndoPropertyModification[] modifications) (at C:/buildslave/unity/build/Editor/Mono/Undo/Undo.bindings.cs:189)
Comment
Your answer
Follow this Question
Related Questions
NullReference on updating animator parameter 1 Answer
[Solved]unexplanable null refrence exception 4 Answers
Animation issue 2 Answers