I’m working on 2D animations in Unity and trying to understand the most performance-efficient and memory-friendly ways to animate objects, especially when avoiding traditional frame-based animations.
Below are the animation approaches I’ve explored so far:
Case 1 – Frame-based animation (Animator recording)
Using multiple sprite frames and creating an animation clip by recording in the Unity Animator. Each frame is added to the timeline to create the animation.
While this approach is straightforward, it can increase memory usage due to multiple sprite assets.
Case 2 – Bone-based 2D animation (Sprite Skinning)
Using a single sprite with bones created via the 2D Animation package, and recording animations by moving bones over time in the Animator.
However, in 2D, deforming sprites using bones can sometimes cause visible distortion, and the animation may not look visually clean.
Case 3 – Code-based animation (DOTween / scripting)
Animating transforms (scale, rotation, position, etc.) directly through code—for example, making an object scale up and down—without using the Animator or animation clips.
Based on these approaches, I have the following questions:
Is Case 2 (bone-based 2D animation) a recommended approach for general 2D animations in Unity when considering visual quality, performance, and memory usage, or are sprite deformation artifacts a known limitation?
Are there other recommended approaches to create 2D animations entirely through code, without frame-based sprites or Animator recording, that are also performance-efficient and memory-optimized?
In practice, how should one decide between frame-based, bone-based, and code-driven animations when targeting low memory usage and good runtime performance?
I’m looking for guidance on best practices for choosing an animation approach in Unity 2D games under performance and memory constraints.
I’m working on a 2D space shooter where animations are primarily effects-based (enemy/player explosions, jet thrusters, and simple jet movement like rotation or scaling).
There can be many enemies and effects on screen simultaneously, so I’m concerned about runtime performance and memory usage rather than complex skeletal animation.
Given this context, I’m trying to decide which animation approach is most suitable.
i would certainly avoid hundreds of animators or tens of bone animations.. especially if this is for mobile too, so using code sounds like most light weight here.
and sounds like ideal case for ECS/DOTS (if want to move/rotate lots of objects),
but i havent used it so cannot say if it makes things much more complicated to work with..
^^ Definitely this. ECS is supposed to be performant with masses of entities, if you’re going for a bullet hell style game this will be the best way to do it for performance and memory usage.
I’m not sure what the ECS workflow is like either, but I agree that code based movement is probably best for this
Performance is unlikely to be an issue for any of these.
Memory usage is dependent on the number of sprites you need. Obviously if you need 10 sprites to show a rotation animation this will take 9 times the memory of simply rotation that sprite object (cases 2 & 3).
Either way, the choices are far more relevant for style than memory usage!
If you want the classic shmup arcade feel you will go for frame-based animations and deal with the memory usage issues. If you prefer flash-like animation look, the Brotato style, then you’ll go for case 3, perhaps case 2 if you have skeletal characters (which you probably don’t have).
Given that both shmups back then and flash-based web games had to work within a couple Megabytes of memory, you can be pretty damn confident none of these choices won’t be a performance or memory issue today.
=> Premature optimization, and the wrong reason to ask the question. What style you want to go for determines how you animate.