Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug InvalidCastException: Specified cast is not valid.

Discussion in 'Animation' started by freedom667, Sep 27, 2022.

  1. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    419
    I get this error When I put keyframe from sprite sheet. I don't know why

    Code (CSharp):
    1. InvalidCastException: Specified cast is not valid.
    2. UnityEditorInternal.AnimationRecording.AddKey (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.EditorCurveBinding binding, System.Type type, System.Object previousValue, System.Object currentValue) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:513)
    3. UnityEditorInternal.AnimationRecording.ProcessModifications (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.UndoPropertyModification[] modifications) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:420)
    4. UnityEditorInternal.AnimationRecording.Process (UnityEditorInternal.IAnimationRecordingState state, UnityEditor.UndoPropertyModification[] modifications) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationRecording.cs:455)
    5. UnityEditorInternal.AnimationWindowControl.ProcessAutoKey (UnityEditor.UndoPropertyModification[] modifications) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:787)
    6. UnityEditorInternal.AnimationWindowControl.PostprocessAnimationRecordingModifications (UnityEditor.UndoPropertyModification[] modifications) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:771)
    7. UnityEditor.Undo.InvokePostprocessModifications (UnityEditor.UndoPropertyModification[] modifications) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Undo/Undo.bindings.cs:274)
    8.  
    does anyone know the solution for this?

    Unity 2022.1.14f1
     
  2. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    419
    Won't anyone help? It's important
     
unityunity