How to Animate Characters in UE5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i'm going to teach you how to use the tool control rig that comes with unreal engine 5 to create characters animations that can be used in games and films and the way control rig works is pretty straightforward first we'll create controls that will allow us to easily modify the pose of the character for example we'll create a control like this one that the head will constantly look at then we are going to use a sequencer to animate the character directly in the viewport of unreal engine 5 and finally we are going to export this animation to an animation sequence asset that we'll be able to use in our games and films okay so first we need to create a contouring asset for the character we are going to animate in my case this will be money from the third person template of android engine 5 and to create a contouring asset you can do so by right clicking in the content selecting animation then controlling right here but to go even faster and skip some of the steps you can search for your character in my case this will be the skm money simple you can right click on your skeletal mesh then select create and then control rig and this will create a new contouring asset with the skeletal mesh you selected you can then rename this new controller asset to cr underscore money for controlling money and then open your new asset what you have in front of you is called the contrary editor interface and this may look familiar to you if you're used to working with blueprints in only engine 5. so i won't go into too much detail since we are going to use most of its elements but just so you know we are going to use the rig hierarchy which is available right here to create controls nulls and bonds that will allow us to modify the pose of the character then in the rig graph part of the contour editor which is available right here we are going to use blueprint nodes to create the logic of how the rigging of our character will work for example it is in this part of the controller editor that we are going to tell henry engine 5 to rig the character so that it will constantly look at a specific control and finally just like i did during the intro we'll use the viewport of the contouring editor interface to move the controls around and see if everything we've set up is working as intended okay so before we create our first control i'll rearrange the interface a bit by moving the viewport in the center of the screen so that you can see what's going on here now i can create my first control which will serve as the root of all the controls we'll create later so here i'm going to collapse the skeleton hierarchy i'm going to right click in the empty part of the right hierarchy tab select new then new control i'm going to press f2 on my keyboard to rename this new control to root underscore control and here we've added our first control which appears in the rig graph as well as in the viewport with the red sphere that you can see right here but we're going to change its shape to fit our needs i'm going to go to the details tab right here on the right side of the screen and you can see that we have a lot of details a lot of properties that we can change and we are going to select the part that concerns the shape here you are going to select the shape properties here and select the rounded square thick this one then i'm going to rescale it to a scale of 10 by activating the lock right here and then put a scale of 10 and finally i'm going to change its color to cyan here if i select the root control i can grab it and move it around in the viewport but since the root control is supposed to replicate the role of a root bone of a skeleton we would like to make it so that it's not possible to move it around and to do so i'm going to select the root controller right here and here you have the transform properties i'm going to click on min transform and then i'm going to hold my shift button on my keyboard and click on max to show both the transform the min and the max transform here what you are going to do is that you are going to check all the check boxes that are available right here so here i'm going to click right here this one this one this one these ones up here and by doing so we are selling unreal engine five to limit all the components of the control transform today to their origin so we tell that the minimum location is zero zero zero the max location is zero zero and what this will do is that as you can see here it's not possible if i grab the control it's not possible to move it around anymore now that our first control has been created we can create our second control which will be responsible for offsetting the whole body of the character so here i'm going to select the root control right click on it select new then new control you also have the keyboard shortcut control plus n if you want to go faster then i'm going to rename this new control to body underscore offset underscore control then i'm going to change its shape to rounded triangle thick this shape then i'm going to change its color to white and here i would like to rotate the triangle shape without affecting the actual transform of the control by going to here shape transform you can change the transform of the shape without affecting the actual transform of the control so here i'm going to add a rotation of one eight zero and you can see that the triangle is oriented correctly okay before moving on to the next part of the tutorial we are going to create a control that will allow us to move the pelvis around so here i'm going to select the body offset control press ctrl n on my keyboard to create a new control rename this new control to pelvis underscore control then change its shape to octagon solid here octagon solid i'm going to change its color to orange and i'm going to rescale it to a scale of five so here we say that i created a control that is parented to the body of set control what this means is that since the pelvis control is the child of the body of set control if i grab the control the body offset control and move it around you will see that its child will follow it wherever it goes now since we want to stick the pelvis bone to the pelvis control we would like to put the control at the same position as the bone and here if we try to move the control at the desired location it goes back to the origin of the scene as soon as we compile the assets so here i'm going to click on compile and you will see that it will go back to the original viewport in fact in control rig when we move controls around in the viewport it's as if we are checking if the rig is working correctly and to better understand what is going on you need to know that each element of the rig has multiple types of transforms so here if i select the pelvis control we saw earlier that the mean and max transforms represent the limits we want to apply to each component of the transform the initial transform only concerns bones and as for the difference between the current transform and the offset transform it's quite easy to understand in fact if i move the pelvis control up you will see that the current transform represents the current transform of the control in space while the offset transform represents its initial transform in space so if we want the offset transform to be set to the current transform you can move the pelvis control at the position you need it to be right click on it and select set offset transform from current you will see here that the offset transform will change as soon as i click on set offset transform from current okay so that's great the pelvis control has a new initial position which is close to the pelvis bone but if we want to place the control at the exact same transform as its bone there's a faster way of doing so so here i'm going to go to the skeleton hierarchy select the pelvis right click on it click on copy or press control plus c then i'm going to collapse the skeleton hierarchy select the pelvis control right click on it and select paste global transform or press ctrl shift v you can right click on it again and select set offset transform from current to lock it in place and you will see that the shape is no longer aligned with the character so we can move the shape here by going to the shape transform and assign a value of 90 to the y-axis rotation okay so now that our controls have been created we can code our first logic in the rig graph and here we would like to make it so the bones to which the controls are assigned stick to the controls when we move them around so it's called fk rigging fk for forward kinematics and i'm going to show you two ways of doing so so the first method works by setting the transform of the bone to the transform of the control so i'm going to grab the root bone drag it in the graph select set bone and then i'm going to grab the body offset control i'm going to drag it in the graph select get control and here i'm going to plug this transform into this transform then i'm going to plug the execution pin in the set transform node and you will see here that in the viewport if i select the body offset control and move it around the root bone follows the control wherever it goes the second way of doing fk rigging works by using the parent constraint node so to do so i'm going to right click in the rig graph type parent constraint here i'm going to select the parent constraint node i'm going to plug it next to the set transform bone here in the child parameter i'm going to put the pelvis the pelvis bone here then in the parents parameter i'm going to unfold the 0 index 0 item i'm going to select a type control and select the pelvis control and what i've done here is that i've added a constraint between the pelvis bone and the pelvis control so that the pelvis bone stick to the pelvis control as we can see here in the viewport and now we are going to create controls for all the spine bones and the neck bones so here what i'm going to do is that i'm going to select the spine underscore 0 1 i'm going to hold shift on my keyboard and select the neck underscore 0 2. then i'm going to right click on this selection click on new and then add controls for selected this will create multiple controls that will have the same transform as the bones they are attached to so here if i hold shift on my keyboard and press here i'm going to unfold the whole hierarchy and then i'm going to parent this hierarchy to the pelvis control here i'm going to select all the spine control spine 1 to spine 5 control then i'm going to change their shape so here i'm going to select circle thick i'm going to put a color of a yellow color right here and a scale of 3.5 you will see that they are not oriented correctly so i'm going to add 90 degrees to the y rotation of the shape transform and you will see that they are correctly aligned to the spine of the character so i'm going to modify the look of the neck controls so i'm going to select the neck one and neck to control i'm going to change their shape to circle thick here change their color to dark blue here i'm going to scale them to a scale of two and i'm going to add 80 or 90 degrees to the y-axis of their rotation so here we've created all the controls for the neck and the spine okay so back in the rig graph i'm going to rig these new controls to their corresponding bones and so here instead of duplicating the same logic as we've done before which would be really tedious we are going to use a function though that will make our life easier so here i'm going to right click in the ring graph type fk chain and i'm going to add the node fk chain to the graph so here i'm going to plug it next to the parent constrained node and this conditional function will constrain the transform of the bones contained in the bones arrays to the transforms of the controls containing the controls array and to create these two arrays i'm going to show you two ways of doing so so first we are going to create the bones array by using the first method i'm going to select the spine 1 hold shift on my keyboard and select the neck too and then i'm going to drag this selection in the rig graph and click on create item array this will create our first array that we will plug in the bones parameter and now that the bones array is created we can create the controls array by using the second method so here i'm going to collapse this i'm going to right click hindering graph type get children here i'm going to select a type control then the name will be the spine one control i'm going to enable include parents and recursive and i'm going to change the type to search to control what this will do is that it will take the spine one control and make an array with all of its children which are the spines spine controls and the neck control so now we've created our second array we can plug it in the controls parameter and now if i compile you will see that in the viewport if i click on the spine control and move it the character will move along with the control [Music] so before moving on to the next part of this tutorial we're going to to tidy it up a bit so i'm going to get the forward solve node i'm going to drag a cable and type sequence then i'm going to plug the a pin to the logic we've just created okay so now we are going to create a new control that the head will constantly look at and to create a control that is placed on the bone of the head instead of following all the steps shown earlier in this tutorial you can do it simply by selecting the head bone and press control plus n on your keyboard to create a new control that has the same name as the bone as well as the word control at the end of the name so as you can see the head control is parented to the head bone and in order to stay organized we want to replant it to the body of set control instead so to do it you can right click on the head control select unparent or press shift p on your keyboard to unparent it then you can drag the head control to the body offset control to re-parent it to the body offset so to be able to aim at the control we want to place the head control in front of the head so here i'm going to press space and i'm going to move the head control in front of the head right click on it select set offset transform from current and then i'm going to change its color to blue and finally before moving on to the rigging part of the head we are going to create a second control called the pull control that will allow us to tilt the head if needed so here i'm going to select the head control ctrl d to duplicate i'm going to parent it to the head control i'm going to rename it to a head underscore poll underscore control and i'm going to move it up in the viewport here and right click on it and set offset transform from current okay so back in the graph here we want to make it so the head of the character keeps looking at the head control what's cool is that control rig has a node that does exactly that i can right click in a graph here and type right click and type aim at i'm going to select the aim at function and here i'm going to set all the parameters of this function so here the object parameter represents the bone that looks at the control in our case it's the head bone you can search for it by clicking here selecting bone and search for head or go in the rig hierarchy select the head bone and click on the small arrow that you can see right here this will fill in automatically the parameters then we have the target which represents the control that we want to look at in our case it's the head control so i'm going to select the head control right here i'm going to click on this small arrow in the target parameter and finally the up vector object it represents an object that shows the direction at which the top of the head should look at in our case it's the head pole control so here i'm going to take the headphone control in the rig hierarchy and click on the small arrow that you can see right here and to make it work as intended we need to set up the axis parameters so the axis parameter that you can see right here represents the axis of the head bone that is supposed to look at the target while the up vector axis parameter represents the axis that is aligned with the head pole control and to find these axes we can right click on the head bone in the rig hierarchy and select control bone transform this will show the axis of the bone head the head bone and you can see here that the y-axis is the one that is supposed to look at the control while the x-axis is the one that is aligned with the pole control so here i'm going to put a value of zero in x for the axis parameter and one in the y component and here for the up vector vector axis i'm going to leave it as is since it's the x vector that is already set up so here if i link the aim at node to the b pin of the sequence you can see that if i move the head control left and right the head follows the control and if i grab the pole control and move it you can see that the hell the head tilts along with the pole control now we are going to create controls for each bone of the left leg and each bone of the left foot so here before doing so we are going to create our first null by going on the foot l bone right click on it select new then new null i'm going to rename this terminal to leg underscore l and what is a null in controller is like a folder that can help us group and better organize our rig so here for example we'll use this null to group all the controls related to the left leg and the left foot and by default as you can see if i select the null here nulls are not shown in the viewport by default and to enable it you can go here on the left corner the top left corner of the screen and select display null and enable this option you will see here in the viewport that at the left foot of the character there is the null that appears i don't know if with the compression of youtube we will be able to see but just so you know there is a coordinate system right here so okay so now that our null is set up we can start creating our controls and since we are used to creating controls i'm going to go a bit faster than usual so first we'll create a controller for the foot bone i'm going to select the foot l bone press ctrl n on my keyboard to add a new control i'm going to parent it to the null leg here that we created earlier then i'm going to change its shape to circle solid here then i'm going to rotate it 90 degrees on y and i'm going to change its scale to a scale of 2. okay so now let's create a control for the ball of the foot i'm going to select the ball l bone press ctrl n on my keyboard parent this new control to the foot l control that we've created then i'm going to change its shape to a square thick here then i'm going to rotate it by 90 degrees on the y-axis and i'm going to change its scale to 1.3 only on the x-axis so it can fit the ball of the foot then i'm going to create a control for the knee i'm going to select the calf l press ctrl n on my keyboard then i'm going to parent it to the foot l control this one and then i'm going to drag it in front of the knee i'm going to select it and drag it here i'm going to right click on it select set offset transform from current and i'm going to rename it to ni underscore l underscore control now that all the controls have been created we can unparent it from the skeleton and represent it to the hierarchy of controls we've created so i'm going to select the leg l null press shift p on my keyboard to unparent it and here i'm going to drag it to my body offset control here okay so now that we've created the controls of the left leg we would like to do the same for the right one and to do so instead of recreating everything by hand we can go faster by selecting the leg l as well as its children right click on it select mirror and this will open a new dialog box that will allow us to duplicate the selected elements and place them on the left or the right leg so here i'm going to leave the mirror axis to x since it's the horizontal axis we want to to mirror then the access to flip i'm going to put it to none and here in search i'm going to type underscore l and in replace i'm going to type underscore r what this will do is that it will search in the selection for the string underscore l and when copying the selection it will change the name of the the copies to underscore r i'm going to click on ok and you can see here that the controls as well as the null have been correctly renamed and placed at the correct location in the viewport so they are placed on the right leg however if we pay close attention we can see that they don't have the same transform as the one they are supposed to be assigned to so here for example if i select the foot r bone this one right click and select control bond transform you can see that the x axis points down and if i select the foot r control you can see that the x axis point up and to correct this problem we are going to set the offset transform of the null and its controls to the correct ones by selecting everything and copying all the transforms from the bones through the controls so i'm going to select the foot r bone press ctrl c to copy its transform select the leg r null press ctrl shift and v to copy the transform right click select set initial transform from current then i'm going to select the foot arbonne control c select default foot r control you will see that the orientation will change as soon as i press ctrl shift v then i'm going to right click select set offset transform from current then i'm going to select the ball r press ctrl c ball r control press ctrl shift and v right click select set offset transform from current and finally i'm going to select the calf r bone this one press ctrl c select the knee r control press ctrl shift and v then i'm going to select the knee control and move it in front of the knee right click on it and set offset transform from current okay so now that our controls are set up correctly we were going to rig everything but before doing so i would like to explain to you the concept of inverse kinematics so earlier in this tutorial when we read the spine of our character we used the fk rigging or forward kinematics rigging which to make things as simple works by sticking a bone to the control that is assigned to it so here for example if i grab one of the the spine control and move it around you will see that the bone follows the control everywhere even if it means giving weird shapes to the body of the character this time for the feet we are going to use what we call ik rigging or inverse kinematics ringing which instead of moving a single bone will affect a chain of bones so here for example contrary to fk rigging when we grab the foot control and move it around for example let's put it right here control rig will try to make the foot bone reach its control so it will move the foot to the control while trying to keep an almost natural shape for the leg so this is an oversimplification of course of the process but hopefully you will understand it better when we when we are done with the rigging of the legs okay so now that you know the basics of inverse kinematics we are going to rig the legs and fit of our character using the inverse kinematics so here in the right graph we are going to start with the left leg and to do so we are going to use a new blueprint node which is called ik two bone so i'm going to right click here right click right click and type ik to bone i'm going to select this and here at first glance it can seem a bit intimidating but don't worry we are going to set it up step by step so first we need to define a chain of three bones that will be affected by the ik rigging in our case we want the bones of the left leg to be affected by the left foot control so here the bone a parameter represents the topmost bone of the chain and in our case it's the thigh ella so i'm going to select the thigh l where is it right here i'm going to click on the small arrow of the bone a parameter then the bone b parameter is the second one in our case it's the calf l i'm going to select this i'm going to click on the small arrow of the bone b parameter and the third bond parameter is you guessed it the foot ella so i'm going to select the foot l and i'm going to click here on the small arrow so now on to the the other parameters at the end control that you can see right here is the control that the chain will try to reach as we saw earlier in our case it's the foot l control so i'm going to select the foot l control right here this one and i'm going to click on the small arrow in the end control and finally the pole vector node is to make things simple the element to which the chain will bend in other words it's like in our settings it's the element that the knee will constantly look at just like the aim node that we used earlier and for us you guessed it it's the knee left control so i'm going to select the knee left control and click on the small arrow here in the poll vector node finally we need to set the axis parameters so the primary axis that you can see at the top of the node is the one that goes down the chain of bones to find it we need to check it in the viewport so here i'm going to select the viewport put it in the middle and here if i go to the rig hierarchy we can go here in the top left corner and activate the display axis on selection but i think that it will be too small for you so i'm going to right click on thigh l control bone transform to see the axes here you can see that x is pointing up that's the same for the gulf l and for the foot l so if we want to get the axis that points down the chain it's the inverse of the x-axis which is the negative x-axis so here in the primary axis we can put minus 1 in the x-component and the secondary axis is the one that points towards the pole control so the axis that is pointing towards the pole control is the y-axis the y-axis is pointing towards the pole control so here we can go to the rig graph and put a value of one in the y-component of the secondary axis so now if i connect the ik-2 bone to the graph and go to the viewport you will see that when i select the left foot control and move it the leg follows the control and if i select the pole control the knee control then it keeps looking at the control so now to rig the right leg you are going to use another cool functionality of control rig i'm going to compile it go to the rig graph i'm going to duplicate the ik to bone ctrl d i'm going to right click on it click search and replace and we can use it like we did with the mirror when mirroring the leg controls that we created earlier so here i'm going to put these parameters here i'm going to mirror axis x axis to flip none search underscore l replace underscore r i'm going to click on ok and you will see that all the names will be changed to fit the controls of the left leg so here i'm going to click on ok and voila you can see that all the bones and control references have been correctly renamed so they're equal equivalent on the right leg so before moving on to the next part of the tutorial we just need to modify the axis parameters of this new node so since you know how to find the values to put in here i'm just going to give you the answer which is 1 for the x component of the primary axis and minus 1 for the y component of this secondary axis so here if i connect this new ik 2 bone to the graph and go in the viewport you will see that the rig is working for the other leg you can make a little dance okay so now we are going to rig our feet so here we would like to use fk rigging to rig the ball of the foot but instead of using the previous nodes we used earlier we are going to do it by learning how to create functions in contouring so here what i would like to do is that when i'm going to rotate this control the ball of the fit will rotate with it so here i'm going to do a regraph on the left side of the screen i'm going to select my blueprint i'm going to add a new function by clicking on the little plus sign here i'm going to rename it to a simple mirror fk here i'm going to grab the details panel and when selecting the simple mirror fk i'm going to add some inputs right here in the details tab so here i'm going to click on the small plus sign i'm going to select a variable of type rig element key this one i'm going to rename this input to let's say bone i'm going to add another parameter this time it's still a re-element key but i'm going to rename it to control then i'm going to add another parameter this time of type name i'm going to change its name to search and i'm going to add another parameter called replace of type name here you can change the color of the node if you want here i can put black for example and now i'm going to make an implementation and explain to you how it works after that okay so here what i'm going to do is that i'm going to call a parent constraint node right click is not working good for me or unconstrained node here i'm going to link this to the entry the bone is going to the child and the control is going here in the parent part item i'm going to link the control input here then i'm going to duplicate this node press ctrl and d on my keyboard i'm going to link it right here connected next to the first parent constraint and then i'm going to unfold the bone parameter here and the control parameter i'm going to drag a wire from the name parameter of the bone parameter i'm going to type replace here i'm going to connect search to old and replace to new then i'm going to connect this to the name parameter of the second parent constraint node i'm going to duplicate this replace node i'm going to plug the name parameter of the control parameter of the function i'm going to plug the search in hold and replace in new okay then i'm going to connect the result in the name of the item 0 in the parents array then i won't forget to change the type to control and here we have our first function so to know how it works we are going to call it in the regraph and i'm going to explain to you how it works so here i'm going back to the regraph i'm going to grab my simple mirror fk function and put it in the rig graph i'm going to zoom a bit i'm going to connect it to the rest of the rig graph and here i'm going to expand the bone and the control i'm going to select the bone ball l i'm going to click on the small arrow that you can see right here to assign it to this parameter then i'm going to select the ball r audible l control i'm going to click on the small arrow right here and here in the search and replace parameters i'm going to put underscore l for search and underscore r for replace this will seem familiar to you since we are making a kind of um of a mirror of applying a mirror to the operation so here what are we what we are going to do is that we are going to take the ball l and apply a parent constraint to the ball l control and we are going to do the same for the ball air the ball r and d ball are controlled so here if i go to the viewport if i select the ball l control and rotate it you will see that the ball of the feet will bend with the control and this will work also with the ball r control if i rotate it we'll see that the ball of the feet will bend with it okay so now we are going to create the controls for both the arms of the character so at this point you know everything that i'm about to do so i'm going to go a bit faster than usual so first i'm going to create a null to group the controls of the left arm i'm going to select select the hand l bone then i'm going to right click new new null i'm going to rename it to arm underscore l i'm going to press shift plus p to unparent it from the skeleton then i'm going to reprint it to the body offset control here then i'm going to add controls for the lower arm and the hand by selecting the lower arm l and the hand l right clicking on them clicking on new then add controls for selected then i'm going to rename the lower arm l control to elbow l control elbow l control then i'm going to reparent them this way the first i'm going to represent the hand l control to the arm l null and then i'm going to reprint the elbow l control to the hand l control then i'm going to change the shape of the hand control here to circle solid here circle solid i'm going to change its color to pink i'm going to rotate it 90 degrees on y and change its scale to 1.5 okay now i'm going to select the elbow control i'm going to move it behind the elbow of the character i'm going to right click on it and set offset transform from current then i'm going to change its color to pink i'm going to click ok and now we can move on to the creation of the right arm controls by selecting the arm l null and its children right clicking on it clicking on mirror putting the parameters that we used earlier so x on the mirror axis axis to flip none i'm going to put underscore l and underscore r i'm going to click on ok and now just like we did for the legs we are going to fix the transforms of the new controls by selecting the hand r press ctrl c to copy the transform select the arm r null press ctrl shift v to apply the transform right click set initial transform from current select the hand r press ctrl c select the hand r control press ctrl and shift v right click select set offset transform from current then select the lower arm r press ctrl c select d elbow r control control shift v then i'm going to move it behind the right elbow then i'm going to right click and set offset transform from current now i'm back in the rig graph and we are going to rig the arms using the same logic we used when rigging the legs so using the ik two bone so first i'm going to call an ik two bone node in the right graph ik two bone node then i'm going to define the bones of the chain by putting the upper arm l in the bone a parameter the lower arm l in the bone b parameter d hand l in the bone c parameter and after that i'm going to define the end control by putting the hand l controller this one to the end control here and i'm going to put the elbow l control to the pole vector node parameter and finally the primary axis parameters i'm going to put a value of 1 in x and in the secondary axis i'm going to put a value of 1 in z so now i'm going to connect this to the graph i'm going to duplicate it to rig the right arm okay i'm going to right click on the node select search and replace i'm going to put the same parameters as usual mirror axis x axis to flip none search underscore l and replace underscore r i'm going to click on ok and then i'm going to put minus 1 on x in the primary axis and minus 1 on z for the secondary axis parameter so now i can connect this to the rest of the graph i'm going to compile this and if i go to the viewport if i move the end of the character the hand control you will see that the hand follows the control the arm follow the hands control and we can move the elbow with the elbow control okay so here we are going to finish the control creation part of this tutorial by creating the controls for all the fingers and to do so we could use fk or ik rigging but to practice even more and learn new things about controlling we are going to use another method for doing so so to understand what we are going to do here we are going to create another type of controls like this arrow that you can see right here that will have a single axis and that will bend the fingers as we move them along these axes so here for example i can select all the arrows drag them down and all the fingers will bend at the same time okay so back to our project we are going to create the controls for the fingers of the left hand by selecting every left finger bones that have the number one in their names so here i'm going to select the index one middle one thumb one pinky one and ring one i'm going to right click on the selection select new and then add controls for selected bones okay then i'm going to create a new null group to group all of my fingers controls by right clicking on the arm l null right here arm l null i'm going to right click on it i'm going to select new then new null and i'm going to rename it to fingers underscore l okay so once the null is created we can parent all the finger controls by dragging them onto the null so here i'm going to select all the finger controls i'm going to drag them in the fingers underscore l null and now that we are then now we are going to distribute the finger controls in front of the hand just like we saw earlier so to do so i'm going to select the finger controls and i'm going to go to their transform i'm going to show all of their transform so initial i'm going to hold shift on my keyboard current and offset and i'm going to re-initialize all of them to zero i'm going to compile and this way all of the controls will be placed on the end now i'm going to place them so that they are in front of the hand by changing the offset transform so i'm going to save the offset transform i'm going to put 5 in x 5 in y and minus 10 in z now we are going to distribute them along the z axis so here i'm going to unselect the thumb control okay i'm still going to select the index middle pinky and ring fingers i'm going to add 5 here i'm going to type plus 5 in the z component then i'm going to unselect the index by holding ctrl and clicking on the index i'm going to add 5 on z then i'm going to unselect the middle add 5 on z and unselect the ring and add five on z now i'll change the appearance of the controls by selecting all of them here i'm going to change their shape to arrow solid this one arrow solid then i'm going to put the color to green here i'm going to set minus 90 to the x rotation and 90 to the y rotation and finally i'm going to change their scale to 0.7 so the color is not green enough and now before mirroring these controls to the right hand we need to do one more thing since at the beginning of this tutorial we've been creating controls that are of type euler transform so here if i select these controls you can see here that we have in the control properties we have euler transform for control type since we only want controls to move along a single axis we are going to change their type to float i'm going to select this and select float right here okay so here we can leave the primary axis to x since as you can see in the viewport i hope that the compression will not be too bad as you can see the viewport this is the correct axis along which we would like our controls to move so however we can see that the rails are too big okay here they are going uh too far from the hand and we would like to reduce their size their size so to do so we just need to change the max value here to 10 instead of a hundred what this means is that these controls will move along this axis and will go only as far as 10 units so before moving on to the next part of the tutorial we can mirror everything by selecting the null as well as its children right clicking on it selecting mirror and here you know the values none underscore l and underscore r and here we can see that the controls have been mirrored correctly on the right hand and before moving on to the next part of the tutorial i forgot something we're going to get the fingers underscore l null and re-parent it to the hand l control and select the fingers underscore are null and re-parented to the hand are control so this way when we move the hand the controls will follow along okay so now we'll start the reading process by first reading the thumbs and to do so we are going to use a new node which is called distribute rotation so here i'm going to type distribute rotation and to make this note work you just have to feed an array of items as well as a rotation and control it will apply the given rotation to each element of the array to better understand the way it works we're going to use it to bend the left thumb so here first i need to select the three bones that compose the left thumb thumb one thumb two and thumb three i'm going to drag them in the graph to create an array and i'm going to plug it in the items parameter then i'm going to add a new rotation by clicking on the plus sign next to the rotation parameter right here and since the rotation needed here is of type quaternion we want to convert it to a euler rotation so that we can define rotations more easily so here i'm going to drag from the rotation pin here i'm going to drag from euler node and to find the axis to which we want to apply the rotation i'm going to right click on the thumb bone and press ctrl transform and you will see that we would like to rotate the thumb around the z-axis so here the z axis so i've experimented a bit and found out that minus 15 works well for the thumb and now if i drag the left thumb control in the graph you will see that it has three parameters which are the current value it has as well as the mean and max values it can have so to make this value drive the bending of the thumb i want to plug it in the weight parameters of this distribute rotation node but since this parameter works with values ranging from 0 to 1 and not from 1 to 10 like the thumb control we are going to bring the control value to a range of 0 to 1 by dividing it by the maximum value so here i'm going to drag a divide node i'm going to plot the maximum and this will bring the value from 0 to 10 to 0 to 1. if i plug it in the weight parameter of the distribute rotation and connect this to the rest of the graph i'm going to compile it and if i go to the viewport and select the left thumb control you can see that if i move it the thumb bends with it so now we can apply the same setup to the right thumb by duplicating these nodes and select these press ctrl d and then i'm going to right click on it search and replace you know the drill yes underscore l underscore r press ok everything is changed accordingly so here i'm going to connect this to the rest of the graph i'm going to compile it and if i go to the right thumb control and move it you will see that the right term bends finally we are going to rig all the other fingers and to do so we are going to use the node for each loop so here i'm going to type four each i'm going to select the four each here and for those of you who don't know how it works before each loop takes an array as a parameter and applies the same logic to each of its elements so here i'm going to type 0 1 in the search bar of the rig hierarchy tab i'm going to select all the fingers that contain the one in their name pinky ring middle except the thumbs of course i'm going to create an array with it create item array here and then i'm going to plug it in the array parameter of the for each node then for each finger bond so here i'm going to create an array from all its children by calling the get children node here i'm going to include parent recursive and type to search bone then i'm going to duplicate the logic we used for a thumb here this logic ctrl d i'm going to plug it to the for each loop here i'm going to remove the rig element key array i'm going to delete it and connect the array from the get children node and this time instead of putting minus 15 i'm going to put a value of minus 70. and finally we want to find the corresponding control for each of these bone and the way we are going to do is by adding a string to the name of the bone so here i'm going to expand the element i'm going to drag a wire from the name i'm going to type concat here then i'm going to plug it in the get control float and i'm going to add underscore control i'm going to connect this logic to the rest of the graph i'm going to compile it and voila if you go to the viewport you can select any node and you will see that the finger will bend with the control okay so now that everything is set up i'm back in the viewport of the android engine 5 editor and we can finally create animations for our character to do so i'm going to get the controlling asset from the content browser and drag it in the world and this will automatically create a level sync sequence and open the animation mode interface so that we can start creating animations for our character i won't go into too much details but just so you know the anime outliner tab that is available right here shows all the controls that are available for animation and the animation tab that is available right here allows us to change some of the parameters of the animation mode and before animating our character we need to set up a few things first we are going to disable snapping for the rotation and the translation here and here and just so you know when moving a control in space you can select the control and move it either in the world transform or object or local transform by selecting the option that you can see right here at the top of the screen then i'm going to activate the auto key feature of sequencer by clicking right here so that it adds an animation key like a frame of animation for those who don't know every time we move a control and finally you can change the frame rate of the animation to fit your needs by going here me for example i'm going to put a value of 60 fps and now that everything is set up you can start moving things and see them animate so here for example i'm going to add a key for all the controls by clicking here on cr money i'm going to click on the small plus sign here to add a control key for all the controls of the body then i'm going to move the playback to frame let's say frame 30 for example here and i'm going to move my head control you can see that the head will follow and while i'm moving the head control you can see here that we have added a key an animation key when we moved the head so we can get the head pole and move it like this get the hand and move like this and you can see that keys are added automatically when we move controls so here if i go to the beginning of the playback and press play here you will see that the head and the hand will start animating so now i'm going to create a small animation and then we are going to see how to export this animation to an animation sequence asset okay so now that i'm done making my aaa animation that you can see right here we can export it to an asset but before doing so make sure that the end of the playback is placed at the end of your animation which is usually the position of the last key so here the red thing represents the end of the playback i'm going to put it at frame 60 and to export the animation to an animation sequence you have two solutions the first one is to right click here on cr money and selecting bake animation sequence but the most interesting solution is to select create linked animation sequence then select the folder at which you want to create the asset for example the content folder here i'm going to click ok and here in the new dialog box that will open you just leave everything as is and click export to animation sequence okay and here if i open the animation asset that was created i can close the sequencer here if i open the animation sequence that was created right here i can go here in edit in sequencer and top of the screen click on it and select open level sequence this will open the level sequence and i can modify the animation if there's something that's wrong with the animation sequence that was created as you saw in this tutorial controlling is a powerful tool for creating animations directly in online g5 and if you want to learn more about animating in an engine 5 you can check this video and i will see you over there press control i'll rearrange control i'll rearrange is oriented in the bad orientation i don't know how to see it to create a new control more faster doing fk the unapparent where is it behind me of course
Info
Channel: Evans Bohl
Views: 186,018
Rating: undefined out of 5
Keywords: unreal engine 5, ue5, unreal engine, tutorial, complete guide, control rig, how to use control rig, create animations, animate in engine, animation authoring
Id: w9mijf-gKOg
Channel Id: undefined
Length: 56min 4sec (3364 seconds)
Published: Thu May 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.