Beginners tutorial #5 - Control rig - Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

This post appears to be a direct link to a video.

As a reminder, please note that posting footage of a game in a standalone thread to request feedback or show off your work is against the rules of /r/gamedev. That content would be more appropriate as a comment in the next Screenshot Saturday (or a more fitting weekly thread), where you'll have the opportunity to share 2-way feedback with others.

/r/gamedev puts an emphasis on knowledge sharing. If you want to make a standalone post about your game, make sure it's informative and geared specifically towards other developers.

Please check out the following resources for more information:

Weekly Threads 101: Making Good Use of /r/gamedev

Posting about your projects on /r/gamedev (Guide)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

👍︎︎ 1 👤︎︎ u/AutoModerator 📅︎︎ Jun 04 2021 🗫︎ replies

Feel free to check out my channel of tutorials. :)

Video link: https://youtu.be/3CKt48BceFk

Channel link: https://www.youtube.com/channel/UCPqAMQsTxwdQfC4_GsJrwkQ

👍︎︎ 1 👤︎︎ u/LeafBranchGames 📅︎︎ Jun 04 2021 🗫︎ replies
Captions
[Music] welcome to this unreal engine 5 tutorial today we're going to talk about the control rig so let's jump into it you should be able to search for control rig and here you have this free project that you can download with this mannequin already set up properly with a bunch of different controls so if you want to go there and study that that is where you go and do that but today we're going to be setting up our own control points just so you see how it is done and talk a little about how they work so let's start with the first part to make a control rig you need to have a plugin you can find it under edit plugins and if you search for control rig you'll get this plugin here which is currently enabled for me if you click that one in and then you need to restart and then you're set up on down front the next step is to find your skeletal mesh for whatever you want to rig and you right click on that and you have something called create control rig up here so just click that and it will take a little moment and that will create the rig for you so let's open that up so here we are inside unreal engine 5 this is currently the early access build so if you want to follow along i guess you would have to have that otherwise if you're further ahead in time then you might actually have some of these options looking a little bit different but hopefully you can follow along anyway so let's talk a little bit about control rig and what it is so control rig is a way to assist you with manipulating and translating bone data it's sort of giving you a a separate interface to to or towards a a mesh basically in this instance we're going to be working against the mannequin but you can use this against any kind of mesh that has a skeletal structure on it because what you need is a skeletal mesh and you can set these things up however currently in unreal engine 5 the early access build i have been having trouble performing some of these features on some other models than the unreal engine mannequin so there might be some issues currently with that in case you try on different things but today we're going to be doing some basic things we're going to be creating some some controls for our character by using the control rig and if you go to the unreal engine marketplace so in here there's a lot of information we will not be touching on all the different aspects we will just be keeping it fairly brief light and easy to begin with but know that there are multiple different this resembles a blueprint basically and and it has similarities to it and it has different um modes to it it has a setup mode which is sort of like a construction script a forward solve which is a way for er by creating this will probably make more sense in a little bit when we start create stuff but by having controls the forward solve will calculate what the rest of the mannequin should look like in positions in relation for its different bones to accommodate for how you have moved the controls the backward solve is the complete opposite it is using motions of the bones in the character to find out where are the controls that you've created should be and backwards and forwards is a solve that runs both backwards and forwards which is sort of a debug mode because it it by running that one you can sort of see when you have made errors so your limbs and bones go out of place and look weird so that's sort of its main feature other than that we have some basic buttons up here we won't be looking into them too much we have the classic compile and save up here we have our viewport and over here on the right we have our details and on the left here we have a couple of tabs you have a blueprint tab an execution step tab and a rig hierarchy tab this is the one that we will be looking at working with for most part of today so to start off let's create a control so what is a control well control you can see as sort of as a an attachment or a handle something that makes it easily accessible for you to manipulate the mannequin in this case to move it around in different ways now the purpose of doing this is for the most part is you can use it for things like animations you can create animations inside of unreal engine if you want to and it will be easier to do that via a control rig rather than doing it manually in the animation animation screen which is very limited and also it can be used for things like if you already have an existing animation you can use the control rig to tweak or clean it up or differentiate it in in certain ways if you feel like with more ease than you would be able to do otherwise which means that you eliminate some if not all of the need of having to take animations out of unreal engine to a different program change it over there and bring it back to unreal this will make it much more easily available to do those changes inside of unreal now that our rig hierarchy resembles pretty much how our skeleton looks for a character but it is not one to one because we can add things here that beyond what the skeleton has so if we wanted to do for example which we'll be doing today a control for our hand so let's find our right hand so this is our right hand over here now to create a control there's a couple of ways to do that you can like add a control and then move it around and place it on on the specific part of the body because you want to have the control nearby where it is affecting so you can sort of at the first glance easily see what it's going to control but an easier way to do this and to get the positioning writing like that is to actually click on whatever part you want to control in some way so first the right hand here and then you ctrl n and you'll create a new control another way to do it would be to right click on the hand and go to the new and choose control over there and it would give the same result so now we have this new control in this control space created so we'll start with renaming new control to hand write control and what we'll do after that is we will right click on it and unparent it now what this does is it basically just removes it from the hierarchy hierarchy so it can lie beneath it and after that we can also remove this control space because we're not going to be needing it for now so this means that we have now created a control and the control is in the location of the bone for the right hand the next part is to create a sort of a gizmo for you to see that you have a control here and you do that from over here when you have your control selected go to the right and you scroll down you have this gizmo section here if you click on the gizmo drop down you get a bunch of selections of how you want the gizmo to look so if we were to pick for example the circle thin you'll see that it has created a circle now around our hand now we might want to have this circle actually be in alignment with our arm so if we change its rotation on the y-axis by 90 degrees you'll see that it will now envelop the arm around it the next part is that this is maybe a little bit big so we can adjust the size to maybe 0.5 in scaling axis for this and you'll see that we have a slightly less intruding circle so the point of all of this is basically now that we can just click on this control at any point and then we will have the control available to to manipulate so we can now move the the control around and scale and translate and such things now if you have done something like that and just want to reset its position you just hold down control and press g and it will reset to the position it had the next step now is we're gonna actually connect this control to the hand and we do this in two steps we'll drag out control and choose get control this will give us a node which represents our control now this is a little bit overwhelming maybe at first but it's it's fine i think it has a type which represents different things like mostly bone and controls are the ones we're going to be using it has a name which is a drop down just for a subset that fits the type it has since we only have one control right now only our handwrite control appears in this list and then it has a a positioning space where it can use its transforms which is the global and local space so keep all of these consistent unless you know what you're doing if you don't want to run into some issues i would say just in the beginning at least by learning the next thing is we want to connect this with our right hand because we have the position here now but we're not actually doing anything so we'll drag our hand r out here and we'll say set transform now what this will do is whenever the position of our control changes now it will send its transform to the hand and the hand will listen and change its transform as well so to demonstrate this if we go in here and we select our control and then we move it you'll see that our hand moves away now this doesn't look awesome because we lose our fingers but press control and g to reset and then you go to this propagate to children checkbox clicking that will make sure that all the bones that are beneath the hand are which includes its fingers will also be following along if you do a translation like this so that's the first thing that we need to do the next thing we want to do is we want to have some kind of a constraint for this arm because we want it to follow along when we do something with it so to do that we'll right click over here i will type in basic ik like so now here you can connect a chain of bones so you can say a linkage of bones here should be taken into account for the end bone here because this last bone over here is the one that's the effector item the one that's being moved so for this one we go down and choose hand r because that is our factor item that we've created this control for and as a bone above it we'll just find the hand r here and see what's the bone above it so that's the lower arm r so we'll find that here lower arm r and above that we have an upper arm are like so so now we have created a chain between these now you see that the model gets all screwed up and the reason for that is that it's going in and if you remove this execution node you can see that it resets so it's getting screwed up here now because there are some settings that are improper the first thing we want to do is we want to get our control to affect this and we do that by dragging our transform just like so we still have issues here with our arm and that is because it needs a primary and the secondary axis to be input properly and i've been trying to figure out these and i have not quite found the answer for it but these do control what your output will look like in the end and i think it's somehow related to left right up down sort of thing but i'm not entirely sure how to interpret this if you do something like this if you right click and you type draw hierarchy for example then you'll see that let's do it like this let's connect the transform over here to the hierarchy and have this basic ik disconnected now you'll see that it will make first of all it will show us all the bones by dragging lines but they'll also show us a coordinate system in the form of said x and y for each of the bones and i do believe that this somehow plays a role but i still haven't been able to figure out quite how anyway not important we we still can't figure this out if you want to see exactly what it needs to be when it comes to these values let's hook this up again you can always cheat and look at the control rig because in in the controller project it's already set up right so there you can see how that works so if we go in on the primary axis and we change this x from 1 to -1 you'll see that the arm sort of corrects itself so let's remove the draw hierarchy because it plots so much stuff out here you'll see that despite having this corrected now the arm still looks wonky and we can demonstrate this further by moving this hand you can see that it's sort of detached and broken still here so ctrl g to reset again now part of the problem why it's looking so wonky is because it doesn't know where the elbow is supposed to go and what you can do is you create another control and we'll call this right elbow and then underscore p v control and pv is this pole vector over here which is a in grouping you can choose to have a direction or a location and what we're going to be creating is we're going to create a point in 3d space where we're going to say that this this point is where the elbow is supposed to be facing so if we uh let's see we marked this so we have some kind of gizmo for it so we can see it and we actually get it at by our feet right now here so it's it's probably a red ball i think by default so let's keep that actually what we can do is we can change the perspective from let's do from left like so so we want to move it somewhere like that so it's by the elbow height approximately then from that we change to let's see front and then we want to make sure that it's actually behind the elbow since the elbow should be pointing backwards so like something like that now we can go back to our perspective view did i not translate that oh okay if we do that again and let's see uh front and we'll move it back and up and i will do left and we'll move it over here somewhere it doesn't need to be super exact for it to be functional but then after we've done that we right click on it and say set gizmo transform from current so that it's actually saving its position then we go back to perspective and did i pick the wrong one there now i'm not entirely sure here we'll see what it looks like otherwise we'll fix it up it's gonna be fine anyway and so now we're gonna be getting our elbow control and we're gonna be using its position here so if we open up this box here we got a translation and we put that as our pole vector like so so that's another piece of the puzzle that's in place now hopefully it does look like it's a little bit wonky still let's see if we can fix this pv control here and let's reset all transforms the gizmo is not reset and set initial transform like so let's start off with something like this now you can see that the elbow is moving then when we're up here we go to set initial transform from oh did i set that one it should be initial transform my bad anyway so now we have a direction you can see here that the elbow is trying to align itself with so we have it somewhere there it should probably be fine um okay now from here if we take our control for the hand and we start moving it now you can see that it's moving better for the upper arm but the lower arm is still a bit broken ctrl g to reset that we also need to make sure that we're propagating to children here now for this inverse kinematics is inverse kinematics in case you do not know it is sort of the way of figuring out how it's usually used for things like when you place a foot somewhere to make sure that it's in in games that tends to be like when you're standing in a slope that both feet are in the same height despite one of the feet are actually in the air inverse kinematics is usually used to make sure that the foot that's in the air instead is placed on the ground and so it so it looks better and then inverse kinematics is the calculations of making sure that all the bones that are related to the foot so that means the the chains the the the knee the thigh and everything like that gets a position that looks good for where the foot is and that is sort of what we're doing here we are moving the hand which is the inverse kinematics and the arm is following along as best as it can to accommodate for where we want to drag the hand yeah i think that's the best way i can describe it you can also see it's something like if you were to place your hand on the steering wheel of a car then your elbow might be bent and if you're rotating your steering wheel to one of the sides then your arm would sort of follow along that's also inverse kinematics but yeah so here we actually have our our first control points which we can rotate and move around and and we'll have like parts of the body actually conforming to it now this is just a first step of course to make use of this you want to have a bunch of these you want to have them for like all the hands and arms and elbows and the pelvis and the legs and the feet and things like that so you have a lot of controls available to you and you have to set up these relationships between them so that they're actually having these inverse kinematics and the relationship so it follows along for what the body is able to do and in the end the point of doing this as i said is to either create or tweak animations and make that more accessible and easier to do inside of the engine we will not be doing that today however this is just going to be covering this part but i hope this gives a a basic understanding of how the control rig works and the different notes that we have touched on so far generally it's not going to be a whole lot more complex than this there's things like items and collections and some other fancy things you can do but it might be a little bit much to begin with hopefully you found this video helpful if you liked the video leave a like if you did not like it leave a dislike leave any suggestions or comments you have down below subscribe and share this video if you want to see more content like this in the future that is all for now keep on learning take care you
Info
Channel: LeafBranchGames
Views: 3,834
Rating: undefined out of 5
Keywords: Unreal Engine 5, UE5, Control rig, Inverse kinematics, Tutorial, Beginner
Id: 3CKt48BceFk
Channel Id: undefined
Length: 23min 14sec (1394 seconds)
Published: Thu Jun 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.