Setting Up Pivot Points and Assembling Character - Part 2

Sandor Kiss
A free video tutorial from Sandor Kiss
Teaching 600,000+ Students, Performance Marketer
4.2 instructor rating • 131 courses • 783,721 students

Lecture description

In this lecture, we'll organize all the body parts of our character in Hierarchy in the most appropriate way for animating our character in future. We'll also apply correct Order in Layer for each of the body parts to get them correctly sorted and displayed in the scene.

Learn more from the full course

Simple and Advanced Topics of Animating 2D Characters

A comprehensive and easy to learn guide to make 2D bone-based characters from scratch.

03:31:52 of on-demand video • Updated February 2017

  • Create custom bone-based animated characters in Unity 3d
  • Work with sprite sheets in Unity. We'll cover importing, slicing and setting up the pivot points.
  • Assemble bone based 2D characters, organize all the body parts in Hierarchy and prepare for animating.
  • Create Idle, Walk and Jump animations for your character. We'll make a Jump animation with an interesting technique that involves Blend Trees.
  • Configure transitions between animations in the Animator component.
  • Write a simple controller script that will let our character move on the level and jump.
  • Use ScriptableObject assets to store outfits of your character.
  • Apply outfits from your custom-made assets to your character changing the way he looks.
  • Display extra clothing and decoration items like bracelets, necklaces as a part of your character's outfit.
  • Make characters with joints that will be able to “turn into” differently shaped characters while using the same animations.
English [Auto] Sometimes you want to have a front view and a back view of your character for example you might want to have the back for you for entering doors and climbing ladders if they will be present in your game. For this character it is not so apparent because there are no suitable body parts for making the back view animations. But still it is nice to have a game object like this to separate things and to make it easier to work with your character. So I'll make this game object that is a whole different view appear at 0 0. I'll make the torso and the legs also appear at 0 0. So I'll change their transformed position manually to appear in this spot. And then I'll burn them to this new front view game object. So now we have this front of the game object that more or less represents our character. Now another thing that I like to do I like to have even more empty game objects above are characters. So for now I'll add two more empty game objects. L creates an empty game object then another empty game object parent. The first one to the second one will change their positions 2 000 and the second one is already at 0 0 0 and I'll change the position of our front view back to 0 0 and I'll parent our front few to these new empty game objects. For example I can call this top most game object character. And I can call this lower game object something like a gravity center or center something like this so it is always nice to have several empty game objects or several layers of these empty game objects before you get to the graphical stuff in your character. It is just easier to work with your character if it is organized this way. So now I'll grab the character and bring it aside to not interfere with our camera. And so far it seems like the all the body parts are arranged almost correctly so we can go on and add more and more body parts so we can add the legs and the lower part of the hands and the other hand and the facial features of our character. And once we do all that there will be another very important stage of setting up our character which is setting the sorting order of all the body parts that your character has. So let me show you what I'm talking about. For example we have these two legs and this leg the one that I'm currently dragging is actually meant to appear in front of our characters so it is meant to appear even in front of this second leg. That is a bit darker here. So-l press controls that to place it to where it was and now we should also adjust its sorting order and maybe even sorting layer. So let's actually selected this second leg that we have and let's change the order in layer for the second leg to minus stand for example so we know that this leg it should always appear behind our first leg that is in front and behind our body the torso of our characters and to make this adjustment we've set its order in layer to minus 10. Let's not change the sorting order of our torso game objects so this three underscore 44 who leave is at a sorting order of zero. Now everything else for example our neck. Let's also give it a sorting order of 10 or maybe even 20. So my point here is you might want to add some other game objects or some other graphical elements to your character later. So my advice would be do not change the sorting order or this order in layer in very small increments. So we shouldn't make it like this we should make the sorting order of the neck be one. So we might want to squeeze something in between our neck and the torso in terms of sorting. So it's always nice to have these gaps like a 10 or maybe let's give it a 20 sorting order so that the neck appears in front of our character and currently the neck appears even in front of the head because the had has this old sorting order of 0. So let's bring the head even closer to us with an order in layer of 30. And now the head appears above the neck which is exactly what we want. And so later will bring in all those body parts. They are already set up correctly because they have their pivot points set up correctly so when I grab this leg for example and I place it over here you can see that the pivot point is located here. And if you rotate the Slagg then it will be attached to the knee and it will let us make the walking animation and other animations for this character. You don't have to forget to parent this leg to the correct leg on your character so you have to make it like this and then you can grab your character and drag it around. So I think that you've already got the points of how to set up your character correctly. And I've already done some work and inside of the SS folder I created another folder that is called prefabs. And let's call this character character. Thirty three for example just for demonstration purposes. So here I already have a character that is fully set up and he has the correct sorting Glarus sorting order and everything else. So I'll grab my character 33 and just to show you how prefabs are made. The prefab is made very simply you just grab the game object from your hierarchy that is set up correctly and you are satisfied with this game object or this character and you drag it inside of your assets folder. It doesn't matter if it's in the prefabs folder or not. But once you copy this game objects into your SS folder it becomes a prefab. So now we have pre-fab of this character and we can drag it from our assets folder into the scene and have another copy of this prefab and another copy of this prefab. So this is the way the prefabs work. I can now delete this prefab repressing delete and I can delete a couple of these characters so I can delete both of these characters that we have just created when we have deleted the prefab this character will be highlighted in red so it'll say that it's lost its connection to the prefab and here it'll say missing. But since we have the correct version of our characters prefab Let's take a look at that. So I'll minimize this character and not to interfere with our you and correctly set up character. I'll just disable this game object here in the inspector. So actually it's not called disable. It is called deactivate so I'll uncheck this checkmark and it'll make our character disappear. And now I can bring in our character the pre-fab that I worked on and it's already set up correctly so if I expand this character we have this game object that is called the center of mass which is an empty game object the front view under the front view we have the legs which is also an empty game object and the torso. So the secured is attached to the legs here. And another important thing that I've done here we don't have to keep the names from our sprites that we have on the sprite sheets so here for these game objects I have actually renamed them so that they have these descriptive names. So for example there is this top REMAUT leg low remote leg. So the lower part of the leg top closer leg low closer leg. I'm not calling them left or right because it will depend on the direction that our character is facing will actually flip our character so it will be hard to tell where is the left leg Where's the right leg. So I'm using these terms. The leg that is closer to us and the leg that is remote or further away from us and the same thing with hands. So I've attached the hands to the body as well. And to the top hands I've attached the lower part of the hands. They also use these Coloe sir and remold words to describe the actual hand that we are referring to. And because we have set up the pivot points correctly we can now animate our character by rotating all these body parts so I can rotate his hands I can rotate his legs in any joints. So this way will make our character animated and it teach him how to walk and this will be the topic of our next lecture. I would like to thank you very much for watching this course and I'll see you in the next video.