itch.io is community of indie game creators and players

Devlogs

Unity animations are a nightmare for spritesheets

Keep Him Alive
A browser game made in HTML5

So after working in projects in the past, especially for 2D sprite animation. I've always just make my own animation handler script. Basically it would just iterate over sprites with a delay between each in seconds, using deltaTime. But after working on a project where someone deleted all my animations in favor of the animation system in Unity, I thought this time I'll do it "properly" and use the built-in Unity animation system for this game jam and hopefully save some time! 

It took a while to understand how it works, for example you need about 3 windows open to manage the library (you need to be able to click on the animations in the folder to turn the loop on and off), the "Animation" tab - with the keyframes, and then the "Animator" tab with the state and transitions node-based editor.

While I understand the animator is great when you have a 3D character and want to do morphs between each animation and link them to scriptable variables... I quickly discovered that when all you need to do is animate a few 2 to 3-frame explosions and muzzle flashes it's the biggest more tedious pain in the ass. So here are the big pains I discovered:

One exception to this could be a character walking cycle if you want to control the animation via script to say which direction they are facing. 

But if you need to animate lots of 2D sprites like bullets or looping objects and maybe transform tweaks (scale them and change colours over time), then make your own script for it for the love of god. It could be 1 or 2 functions with about 6 lines of actual code compared to hours of clicking and boxing through all these animation systems that were built for 3D character animation, and not for simple transitions.

I hope you learned something about the animation system at least and if you've also experienced this pain (anyone that's done pixel-art sprites, I'm thinking of you) chuck a like on this post.

Good luck on your game jams and big games you lovely people.

Leave a comment