- Home /
Best workflow for multi-part sprite (bone) animation
Hello folks, I've been away from Unity for a very long time now (real life is a bugger sometimes), but I wanted to get back into it to play around with some stuff. I've been wanting to do some 2d work for sometime and now Unity seems to have more support for this sort of stuff.
My question is this... I have a character (sprite) that I've broken up into multiple sprites (for instance a head, body, upper arm, forearm, hand etc). I see that you can use the unity editor to actually add animations (change scale/transform/rotation) which is really spiffy... but I'm having issues animating my character to keep his feet on the ground and such things. What I'm asking is what the current best practice is to animate 2d characters that have multiple moving parts? (such as a bipedal hero with arms and legs). I am not against getting middleware packages, and I see the smoothmoves and puppet2d packages. Seems puppet 2d can do what I want with IK... but it also seems to convert everything to 3d meshes... I was hoping to stay in Unity's 2d workflow. Does anyone have suggestions for the best practices in this area or what frameworks are the most popular at the moment?
Thank you!
Answer by kacyesp · Aug 30, 2014 at 09:07 PM
Since you're just asking for suggestions, I think I'll chip in :) Puppet2D is amazing. It's definitely a time saver once you get the hang of it. Like yourself, I was worried about the overhead of meshes (and the bones, controls, etc.).
If the overhead ever becomes too much, you can use this to convert the animation to a spritesheet: http://bobstudios-en.blogspot.co.uk/2012/09/frame-by-frame-exporting-animations.html?m=1
However, if you're feeling lazy about converting the animations to a sprite sheet, there are ways to reduce the overhead. Here's one of the responses I got from the creator.
"There are three aspects to the overhead of using puppet2d: 1. Control scripts These are always being updated at runtime - but the good news is you can remove this overhead by baking the animation onto the bones using the bake animation button 2. Skinning The most optimised use of puppet2d is by parenting sprites to the bones. There's a lot of you can get away with doing it this way. Skinning is for when you want multiple bones affecting the vertices. You can optimise it by using 1 bone skinning as well. 3. Bone Gameobjects There is hardly any overhead in having multiple gameobjects themselves. However more keyframes will affect performance a bit."
Interesting. Perhaps I'm just not understanding the workflow of Puppet2D. Am I incorrect in assu$$anonymous$$g that the package requires you to turn sprites into 3d meshes before applying the bone structure? Or am I able to simply skin pre-existing sprites onto bones? This is really the functionality I believe I'm looking for. I want my hero to have multiple equipment pieces that he can wear and his animations won't change, he'll just be wearing different stuff..... Does Puppet2D actually work with sprites directly?
It does work with sprites directly! The workflow of Puppet2D is that you position your sprites in the scene, add bones to it, then convert sprites to meshes if necessary( and Puppet2D does have a button to do this), modify skin weights on any meshes you made(so limbs don't look weird when you bend them), and then animate.
It's really nice. Even though I don't break up every limb into individual sprites, I use Puppet2D to convert them to meshes, play with the skin weights, then do any animations I want. And you don't have to convert everything to a mesh, only the ones that are necessary.
Also, here's a tip if you do get into puppet2D. Pay 110% solid attention to every little thing he does in his tutorial video on youtube. All the information you'll need is definitely in the video, but he doesn't emphasize key points very well so they might just gloss over you if you're really not paying attention.
omg sorry for the spam, but I realized I didn't address a key thing you wanted in terms of functionality. It is VERY easy to attach equipment to the animation once it's done. For example, if you have a sword, you could just drag it under the wrist bone and it'll move with the wrist. I don't have any experience with full body armor yet, but I have a feeling you'd have to re-skin that. But if you don't care for it to change shape, then you can just parent it to the appropriate bone and you're good!
Your answer
Follow this Question
Related Questions
Animation with bones, Limb Solver knee is bending in wrong way 1 Answer
Adapt locomotion system IK to position hands in animation? 1 Answer
Mecanim IK -- Usage? 0 Answers
Use IK or what? 1 Answer
IK Pro only ? 2 Answers