THIS IS A GUIDE TO ANIMATION IN UNITY!!!!!

 

First, you'll need to create your puppet, which is covered in this guide. Once you've finished, start reading this!


Alright, first off, you will need to make sure that you've put your hierarchy together right.

Before you link your puppet together to anything else, you'll need to create what amounts to an empty container to attach all your other pieces to, including the pelvis or whatever constitutes the center of movement. To do this, go to hierarchy -> create -> sprite. Then rename it to whatever you want your rig to be called.

The puppet guide covers it in more depth, but basically you'll be dragging pieces of your rig onto the stage, and then when they show up in the hierarchy, drag them to what you want them to be parented to. It'll create a dropdown of indentations, with whatever is farthest left being highest on the hierarchy. My empty shell sprite thing is the topmost one on the roshambo rig, named RoshamboBlue. The pelvis, also known as the COG sometimes (Center Of Gravity) is parented to it, and everything else cascades underneath.

NEVER ANIMATE THE EMPTY CONTAINER. It exists to be movable for the programmers (so they can just put it anywhere/flip it/etc), and animating it on the art side basically means it can't be used in a game because you already gave it parameters. You can key anything else, and frankly, with everything attached to the pelvis, moving the pelvis will move the entire rig. To reiterate: there is no reason to grab or move the container!

Like I said before, never move the container. Always move the pelvis. If you need to grab a piece that's hard to click on, you can always click on it on the hierarchy and you will immediately see it selected and highlighted on the stage.

Anyway, you're probably ready to animate. You can start by clicking on the Animation tab at the bottom of the screen, next to Projects.

Now click where it says [Create New Clip]. Once you've already made more than one animation, it'll pull up a list of all animations you've made in that project so far. To switch between animations you can click on them on this list too. But right now, just click to make a new one (it's the only option you will have initially).

It's going to prompt you to name your animation and ask where to save it. Make sure to save it in the ANIMATIONS folder. If there isn't one (I can't remember if it's a default) you can make one by right clicking in your Project tab assets area and creating a new folder. Basic stuff like you do on your desktop, just doing it in unity. ANYWAY.

Now your animation menu probably looks like this. Blank. But it's ok. You'll cover it in keyframes soon (the little diamonds).

Grab that red line and drag it over to the 1 minute mark (or wherever you want your animation to end, timewise).

Grab the COG/pelvis/whatever and move the rig somewhere. I just dragged it off to the right. This will immediately change its position values, and key them at the endpoint of your animation. Keyframes look like little diamonds on your screen, and Unity will generate a basic movement from one key to the next without much finesse, which is why you have to finesse it yourself later. Anyway, keyed stuff turns the numbers red on position, rotation, or scale.

Also a sidenote, to easily grab the position, rotation, and scale tools, look to the very top left of Unity, right below File and Edit. The + is position (though you can do some rotation if you see the arrow pop up along the side of a given object while selecting it), the arrow circle is rotate, and the box with arrows coming out of it is scale. All these values can be keyed, if you want things to move, turn, or get bigger/smaller/squash/stretch.

The hand tool before all of them lets you move your screen view around, without affecting anything. Using it has no bearing on the animation, just your view window.

Congratulations, you've just animated something! But this isn't really for animation so much as prepping your window TO animate.

While still on the final frame of your animation, go back and input 0 to all position values to re-center your character. This is important to the whole thing I said before about containers and programmers - the centered values (0/0/0) are corresponding to the container, whose values the programmers need to be the ones to change. Keeping an animation centered is important for things like loops - idle, walk, run, etc, things that loop back don't need to be moved forward by you, they just happen in one place and are moved in the game by the programmers since they will correspond to player actions how fast and far they go.

Also, now you've keyed the space of your animation more easily than messing with that stupid Add Curve button. Moving things to a different key, back or forward, will change where the ending is based on wherever the last key of any kind is. To grab all the keyframes on one frame, you can use the diamond that is sitting at the very top, on the dark grey bar. That will select every key on that frame and allow you to shift them all at once.

Animation on the computer is basically just carefully timing the use of position, rotation, and scale. You can now go crazy and do all three of those things wherever you want on the timeline. Each time you change something, a new diamond will appear. You can delete them, move them, copy them and paste them somewhere else to rewrite something (ie if you need a loop to start and end in the same position).

I would advise working from the COG to what connects to the COG onward when blocking something out. Changing the COG's position or rotation late in the animation can mess up all your hard work pretty easily by completely rotating or moving everything else into a weird position, so make sure it's approximately what you want earlier on so you don't cry tears of blood as you re-position everything from one tiny rotation of the COG.

This is going to happen anyway, though; welcome to ANIMATING.

Each time you move something it will appear along the side of the animation window, as it is now part of the animation sequence, which will get pretty crazy fast, so make sure you have given your puppet's parts very obvious names - or just make it a super simple puppet so you don't get lost in 20 pieces.

unityguide_11_animation.png

When you're done animating, you can basically rinse-repeat at the create new animation point, and make more animations. But once you've got them all done, now you have to get them back out of unity, in a format you can give to the programmer to implement.

It's actually pretty simple!

You're going to export a package, and to do that, go to Assets and click Export Package.

To your horror, it has automatically checked all the boxes. This will not do at all, mainly because that means you are packaging all your save files and various other unnecessary miscellany too, which the programmer doesn't really need.

At the bottom of the window, click None and it will deselect all so you can select only what you want to package..

The things you do want to check off so you can send them are

  • All of the .anim files you want them to have
  • All of the sprite sheets relevant to your animation
  • Probably 1 copy of your most recent unity scene save file in case they want to troubleshoot anything themselves

At that point you basically hit the Export button, name your package, and Unity will compress everything into one easy to send file. You can attach it to an email and send it, or upload it to a shared drive, or whatever! That's all you need to do.

CONGRATULATIONS, because you have now successfully animated AND exported animation in Unity. Go you!