Unity has an excellent animation tool for 2D art that can be used for pretty much any sort of 2D sprites like characters and creatures. This lesson will introduce what rigs and teach you to utilize them in the animation process.
The term rigging comes from a 3D pipeline, where assets are rigged to make the animating possible. Rigs are kind of a skeleton of the asset, single parts of that skeletal form are called bones and they are connected to each other by the joints where the assets can bend.
This lesson teaches you to set up a 2D sprite with a rig and start animating it. The lesson provides a sprite as well, but you can also use a sprite of your own.
Open Unity and start a new project. The Unity version in the videos is 2020.2.2f1, the older versions might have differences, so it's recommended to use at least the 2020.2.2f1 version.
To make things simple, you can use the character sprite that you can download below. Save it to a folder that is easy to find.
Let’s go through a few things before we start using the Skinning Editor. The Skinning Editor is a tool for creating a skeleton during the rigging process. The editor is made of three groups of controls: Bones, Geometry and Weights.
The skeleton is made of bones (also known as a rig) that will be bound to the sprite and make it able to move and bend. Preview Pose allows moving and rotating bones to see how they affect the sprite. Edit Bone is for moving, repositioning, disconnecting, and reconnecting bones. Create Bone adds new bones and Split Bone splits one bone into two.
Geometry in Unity is a mesh of vertices that assigns the existing bones to a mesh. Auto Geometry creates the mesh automatically and adds weight to the mesh with colored vertices. The colors represent the bone's area of influence on the mesh and sprite. Edit Geometry allows making edits to the edges and vertices if needed. Create Vertex creates new vertices and Create Edge creates an edge between existing vertices. Split Edge splits the edge.
Weights determine how much bone has an influence on the area. This group is for editing weights, and you can edit individual vertices' weight through Weight Slider and Weight Brush. Bone Influence will select which bones influence the sprite.
The Skinning Editor may seem confusing at first, but fortunately, it's quite easy to learn, and a beginner won't need all the settings at the start. Unity does a lot of settings automatically with a click of a button. Watch the video below to learn more about the rigging process.
Tähän tulee video, joka on haettava Risestä.
You can edit the geometry with the sliders. Outline Detail adds more vertices on the outline, and Alpha Tolerance will set the value threshold. Subdivide will adjust the tessellation of the mesh by adding or decreasing vertices inside the mesh. The Weights tab will create the weights between the bones and the mesh.
IK is an abbreviation of Inverse Kinematics and a way of automatically calculating the movement of the joint angles. For example, a leg or arm based on where the end effector should be, in this case foot or hand. During the animation, lifting the hand will make the entire arm follow, and IK will calculate the right angle for the joints. With IK animating is faster and more efficient.
Watch the video below how to set up IK for arms and legs.
Tähän tulee video, joka on haettava Risestä.
The next part is the actual animating. If you don’t see the Animation tab on your project, you can find it from the Window section on the menu. Watch the video below on how you can start animating the sprites.
The above is the Animation timeline. The red dot on the left top corner is the record icon and must be activated so the changes are saved. Every bone that has had any changes made will appear on the list on the left and the actual timeline seen on top. Each frame that has an action is indicated with a dot.
Tähän tulee video, joka on haettava Risestä.
As you noticed, it takes some time for the fun to begin. But it building a solid foundation will help you immensely later, so you should focus on the first steps. If you need to make any changes to the sprite's rig, you can make changes easily by going back to the sprite's Skin Editor.