Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Difficulty dragging sprites onto animation screen

Discussion in 'Animation' started by Muckytears, Jul 18, 2015.

  1. Muckytears


    Jul 18, 2015
    So to keep it brief I'm trying to make a 2d game and wanted to try and implement an animation for my character. I have imported all the key frames, given the player an animator, attached an animation controller, selected the character and then created a new animation called 'MoonRun'
    When i try and drag the sprites to the animation timeline I get this little pop up

    and by clicking either of them I get this error message

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditorInternal.DopeSheetEditor.SelectTypeForCreatingNewPptrDopeline (System.Object userData, System.String[] options, Int32 selected) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs:705)

    I was using a video guide but their screen looked a bit different and this didn't occur and have tried looking through other asks for similar problems but couldn't find the answer.

    If it has any impact, these are the properties of the character game object at the moment

    Any help greatly appreciated
  2. Wadadeo


    Aug 27, 2015
    Same problem for me, couldn't find an answer too...
    Any solutions ?
  3. Pork-Roll-Lover


    Sep 10, 2015
    I am getting the same problem. Is there a fix for this? This is clearly a bug with the Unity3D editor. thanks
  4. Alpants


    Mar 21, 2014
    I am experiencing this also. The problem seems to be getting the sprite element of the sprite renderer added as a property of the animation. I found a work around:
    1. Make sure your game object selected and your desired animation is selected
    2. Press the record button on the animator. The animation component should get unchecked in the properties window and turn pink
    3. Drag your first sprite into the "Sprite" property on the Sprite Renderer object attached to your game object in the properties panel
    4. This should automatically add the sprite component to the animator and add your first sprite. Now you should be able to drag one/more sprites into the animator as you normally would.
    Hope this helps!

    If it doesn't, you could try copying / renaming an existing animation file that has the sprite renderer component already attached, then erasing all sprites manually to start fresh.