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.
Any help greatly appreciated
Mine fixed itself when I updated Unity to the latest version. If you are already on the latest version of Unity I can only assume that a re-install would serve the same purpose.
This seems to be a duplicate of http://forum.unity3d.com/threads/difficulty-dragging-sprites-onto-animation-screen.341881/ Here is the answer I posted there:
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:
- Make sure your game object selected and your desired animation is selected
- Press the record button on the animator. The animation component should get unchecked in the properties window and turn pink
- Drag your first sprite into the “Sprite” property on the Sprite Renderer object attached to your game object in the properties panel
- 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.