Unity 2019 2D Rig Tutorial (without PS/PSB files)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] tutorial with me Rami fuzzy and in this video I'm going to try to explain how to create a 2d array using unity the latest unity 2019 and there are a lot of changes since unity acquired the anima 2d plugins and but now the setup it's very easy it's much easier than before so let's take a look first I've created a new project here and here I've import a character and this is basically a character with separate body parts and why did I do this tutorial because most of the tutorial I found on internet are mostly using the Photoshop files namely the PSD files and for those who doesn't have access to Photoshop that could be a problem ok so now the first thing we need to do first we'll to import the assets and I've already put the character assets here and there is a lot of art assets on the internet that you can search for and try to use that and the next thing that we need to import is we need to go to the window and then under the window menu we have this package manager and then let's just enable the show preview packages and currently it's loading packages once it's finished we can just filter out and type 2d and it should be here once it's finished loading ok so now the preview packages has been loaded and the package that we need to import is the 2d animation so let's just select the 2d animation and then install press the install here in the bottom right and once it's finished install we need to also install the GDI key for creating the I key control and I case stands for inverse kinematic okay now it's important all of the scripts once it's finished let's just import the 2d i key ok now our 2d animation commands has finished installed let's just go to the chili I can and press install okay now we have installed to package that we need to create a chili rig let's just close the package manager and then under this Kara these sprites assets here go to the inspector and then press the sprite editor open it and here under the sprite editor now we will have access to the skinning editor so let's just press the skinning editor and now we need to create the bones on each of the body parts so the first bones that I will create it's the pelvis because I want the pelvis bone to be the root bones for all our other bones that we will create for this character so this will be the bones that have the most upper links compared to the other bones so let's just press create moans and I'm going to create a bone here oh you need to double click on the sprite first on the opaque area of the sprites and then once we have this orange outline we can create the bones and it will automatically create the other bones but for this I am going to press right click to cancel it and then I want to create a new bones on the body here so let's just create two new two bones and this will be the spine oh sorry we want to repair on the bone so let's just set this bone here choose the parent to the child of the first bone as you can see here if we press the repairing bones you see we have this options and we can drag the bones and now if we zoom in you'll see that we have this a slightly transparent link that indicates the yellow bone here are parented to this red bone here so let's just create another bone and then I'm going to click on the the root of the green bone here the bottom part of the green boon and then now we can create a new bone that are parented to the screen bone but doesn't stuck in the edge or in the pointy parts of the screen bone here so let's just create the hand bones and this would be the upper arm and this would be the forearm and this will be the hand that's it and for D this will be B right arm and for the left arm let's just set this the same way as our right arm and now that we need to create the neck and the next should be the child of this bone also the spine bone so let's just create here and then now the head bones should be also the child of this neck bone so we want to change the parent so just press the base of the blue bones here that the neck bones and it will change parent and then we can create the head bones like this and then I'm going to right click twice to disable the bone creation and now we need to create the electrons so the bones the leg bones needs to be the child of this pelvis so let's just select the pelvis again and then here as you can see we are parenting the leg bones to the pelvis so let's just create three new bones for each of the leg like so and for the this should be the right legs ok so now that we have created all of this bone here let's just rename the bone so it's easier for us to manage and just select edit joints and then when we select the bones here as you can see we can change the name so I'm going to call this head and then this should be the neck and I'm going to fast forward the video [Music] [Music] okay so now we already renamed all of the bones here as you can see and for the arms I just add a coat here corresponding to the rat sorry - the right arm or to the left arm and once we already set the bones here we need to we need to quickly give it refers so and you can set the outline detail and this is it will create how many subdivision or how many points corner points for each of our sprite here and this is the avatar and tolerance and it will create holes if there are any and subdivide will make sure that inside our mesh on each the body parts will have a quite high resolution hence it will create better deformations and for these settings it seems to work the best but if you have performance issues or if you have too many characters you can always lower the values and once we set this the amount here we can just generate select that and we can automatically set the initial weights to each of the points to correspond to the near the nearest bones so I just press generate for selected once it generates you can see that our hats gets influenced most by these head bones and the neck bones and so forth and as you can see the area that gets influenced with the bones will have the same color as the bone so this seems works very good so far so let's just press apply and now that we already set the sprite we can just track the sprite to our scene here and you see that we have tests but now we can separate these things into bones by adding the sprites skin component and it will automatically create two new component the sprite skin entity and the sprites skin script so now we can just press create bones and automatic create the bones and it will list our bones with the corresponding names here and now if we expand this we will have all of the child object the bones as the child object of our character so now we have the set up we can just start positioning so let's just drag the neck here and move it to this position here and for the head I'm going to move this to in front of our neck here but as you can see we have an ordering issue so we are going to fix that later but now let's just set up our bones and if you want to you can always rotate it okay and then we can move it and then we can rotate it so it fits our character and then for the body we can just move it down so it covers our pelvis partially and move and since the pelvis is the most upper bones in the hierarchy it will influence all of the child bones here and I'm going to move the thigh and it should be the right flags and this one will PD I'm sorry oh this is should be the left and this one will be the right legs yeah so now we have set up our character let's just save our scene and then here under the character sprites assets in the project panel let's just go to the sprite editor again and then go to the skinning editor and if we select edit joints here never take it and you will see our bones let's just select the head bones sorry not the head bones the first one that we want to select is the Sai the left eye and we want to we want to set this part of the sprite to be behind our pelvis so as you can see the pelvis have theft of zero so now we need to set this to a smaller value than zero so it will eyes behind our pelvis and the lower the number it will get rendered first but the higher number of the depth it will get rendered less so let's just set the left eye to negative one and also the left knee and unfortunately we cannot select multiple bones so we have you set this one by one and for the right if I'm going to set this to 1 so it will get rendered in front of our pelvis since our pelvis have the depth of 0 and same goes with our hand but I want to set the left arm to be also behind our left leg so this will be negative 2 and also before I'm negative 2 and the same goes with our left hand this should be also negative 2 and our upper arm we want to set this to in front of our body but also be in front of our left leg so this will be positive 2 and the same goes with the forearm this should be 2 also and the left eye sorry the right the right hand also 2 and for the neck I want to set this to 1 and for the half I want to set this to also 2 and if we want to make sure that our hands is always taste in front also against our hat so we can just select the right arm again and then set this to a bigger value then chew for example 3 should do and yeah so now that we have set the order just press apply and if we cross this predator you'll see that in our scene we will have the right order so now that we have set up the bones let's just set up the eye K so now let's create an eye k and in order to create the I can let's just select our character on our scene here hierarchy and let's add a new component called I came in a chili and here we need to add a new controller and in order to add a controller just press the plus button here and then we can select a couple of IQ types here but I'm going to choose the limb this will automatically create a new empty game object and we can just move the anti game object and we can just reposition the empty game object to the limbs that we want to control here so for example and this would be the right leg so I'm going to rename this to right leg and once we rename the empty game object we can use a custom icon so it will shown in the scene view here and now in order to control the like here just select the most lower part of our Ike a chain that we want to control for example this the right leg should control our right foot here so direct the right foot as the a vector and just set the target to none here and once we create the target it will automatically create the I K so now and once we create the target as you can see it automatically sets the target here and I believe the target is child of our right leg here and this is the target and unity will handle this handle that automatically so now we can control this and if the flip or the orientations of our I K is somehow wrong you can just always enable the flip options to see if it's wrong and if it's flip then we need to disable it so okay and I'm going to create the rest of the I K and now as you can see as I create the right arm the I K it's messed up so I'm going to enable the flip option so it will flip back to the correct direction of our I K and now for the left hand let's just rename this choose a custom icon so we can see it on our viewport and here just drag the left hand and for this I can limp to work we need to make sure that the limb have have three chains so for example for my arm it has the upper arm forearm and the at the end so it will not work if we only have two bones or more than three it has to be three bones so make sure of that and here I've set the left hand as the target vector so let's just create target and it will automatically create a new bone and the direction is flipped so I'm going to enable the flip options and now you see that I can move the arm and if you want to rotate you can always rotate the IQ controller there you go so if we rotate it our arm will rotate okay so once we've created the eye k we can just create the animation bu the way by selecting the parent object or the character object and just press create and let's just call this waving and once we create the animation and we can always open our hierarchy here are the character hierarchy just go to a certain frame and then select the arm for example the right are at the left arm and then move it here to this position here and then rotate it so it will automatically create a keyframe for it there you go so now we have this animation and we can just move the hand a bit to create a waving motion like so I'm not the greatest character animator as you can see here but I hope you get the idea on how to wreck this and to create the animation using this and once you create the animation you can use this character and the animation and the you can arrange the animator because once you've created character you will see that it's like the usual 2d object or the sprite object or 3d 3d character it will our animator will consist all of the clips that we have and then we can set the transition and then we can trigger those animation by our script so yeah that is basically how to create a character and as you can see the the body is messed up so I need to change the order here let's just go click fix this under the skinning editor in the sprite editor I'm going to select a bit double click on our sprite and then set this to 1 but if I set this to 1 then I need to move our neck here to 2 and not 12 but to sorry this should be 12 and sorry this should be 2 and for the Hat bones I'm going to increase the depth to 3 and 4 the right hand I'm going to set this to 4 okay press apply and this will fix the issue here just move over yeah we still have issues with the left legs but yeah we can always increase the depth and yeah there you go on how to create HUD I carry using the latest unity and basically the process is quite simple compared to previous way of doing it so yeah I hope you find this tutorial helpful and if you liked the video please subscribe and as I'll see you in the next video
Info
Channel: Romi Fauzi
Views: 61,889
Rating: undefined out of 5
Keywords: Unity, 2D, Character, Rig, 2D Rig, Anima 2D, Ik, Bones, Tutorial
Id: EZtpACxCTEE
Channel Id: undefined
Length: 17min 23sec (1043 seconds)
Published: Sun Sep 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.