here's why VFX artists love Unreal Engine - Easy Character Animations!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everybody it's mike from production crate and today i'm actually going to show you guys how to download almost any one of our characters and bring it into unreal engine if you download any one of these biped characters any of these humanoid characters it should work with what i'm about to show you guys so i'm going to use a superhero guy but you could use scuba man or cyborg model whatever you want let me go ahead and download superhero mail once you've downloaded that this is what you should get in the folder in this particular character we have two different versions so for unreal we want to use this one that doesn't say udems and inside we're gonna have an fbx and then a folder with a bunch of textures now this guy comes with a cape uh just to keep it simple i'm gonna open up in my modeling program and delete the cape i can show you guys how to do cloth and unreal in a different video okay so i've got him here in maya and this cape here is totally optional it's a separate object so for this video i'm just going to go ahead and trash it and let me just re-export him and i'll just replace the old one all right now i've loaded up unreal for this tutorial i'm going to be using unreal engine 5. it's experimental in beta right now so if you don't have it or you don't feel like using it that's totally fine this tutorial will work exactly the same in version 4. so i'm going to go ahead and launch unreal five and when you get to this preset window we're gonna use the game preset called third person this will actually work with the top-down uh version too but you might just have to change some of the naming conventions if you're experienced with unreal engine already you'll know how to do this so i'm just going to name my project all right so i'm loaded up here in the third person template uh you'll notice that i've deleted the walls that come with the project and i've made this ground a little bit bigger because we're going to make our character run really fast i want to give them some room but everything else should be default how you guys see it quick note if you're using version 4 you'll probably see a window down here at the bottom if you're in version 5 you don't see it the hotkey to have it pop up is ctrl space and if you don't like pressing that over and over then you can just hit dock and layout and it will stay there so whatever feels more comfortable for you so what we want to do is we want to just basically replace this default robot character with our superhero character so i'm going to go here i'm going to go into the content folder and i'm going to make myself a new folder so if you right click over here i'm going to make myself a new folder just for the superhero new folder and i'll name it superhero [Music] so inside the superhero folder we can start importing our assets so i'm going to click on import right here and i want to go into the folder where i saved the fbx and just import that so when this comes up the default setting should be fine i'm just going to hit import all now this character is already rigged using the mixmo skeleton if you have a character that isn't rigged yet then it's best to take that up to miximo first and let it auto-rig but all of our humanoid characters are already rigged using mixamo so with this character you'll see that it loaded a whole bunch of things the main things we need to pay attention to are the the model itself and then we have what looks like a copy of the model but it'll say physics asset and then we have the skeleton and then any materials attached to the character so this character actually has a lot of materials you can see here we can try to organize this a little bit by making another folder for materials and i'll just grab all of these spheres and all the textures too and i'll move it to the materials folder so we should end up with three objects and a materials folder now if we double click here we can see the model looking pretty good and just to make sure that the rig is working i'm going to drag the physics asset out here into the scene you can actually press play and you should collapse like a rag doll that shows you that the rig is actually working so now we actually need some animations like i mentioned he's already rigged with mixamo so if you go to miximo and upload your character it'll just work there's no setup to do at all so i'm going to pick a few different animations that we need you want to find a good idle animation for when he's not moving and minimum you need a walk and a run i'm going to go a little bit more advanced so you could also get walk and run in all four directions so walk forward run forward walk back run back and then also left and right and if you want to you could also grab a jump animation or even a sprinting animation one thing to take note of is when you grab your looping animations like this walk right here make sure that it has an in place check box and you want to make sure you check that so he walks in place like he's on a treadmill some of these don't have that like this walk backwards arc so this wouldn't be a good animation for this tutorial i actually have a walk that i really like i like the dwarf walk because it looks really confident so he's walking i'm going to make sure i press in place and download that all right so here's all the animations i got again minimum you just need idle walk and run but i got walk and run in all four directions plus a jump so let's go back into unreal engine and import those so i created this animation folder to keep it organized i'm going to go over here to import and i'm just going to select all these fbx's that i got from mixamo and when this pops up it's really important to uncheck import mesh because we already have the geometry we just need the keyframes on the bones uh next step right here where it says skeleton if you click on this you can see that there's actually two skeletons in our project so far because the default white robot is there and then we have the hero so i want to associate it with my hero now this right here is a rotate x sometimes these miximo animations come in sideways so if that happens just delete them and type in 90 right here make sure you press like to make this load faster there we go okay so here's all of my animations loaded if you want to test it you can just double click on one of them and you should see your character moving walking in place before we can get him walking around in the scene let's get the materials finalized so if i go to the materials folder you can see that it imported all the materials from the fbx and imported the color maps but it doesn't load all the other textures automatically so let's do that really quick i'm going to go to import i'm going to navigate to the folder that downloaded into the textures and you don't want to import these exrs in this case this character has a displacement map that's not really good for games so we don't want to import that into unreal but we can get all the other textures so i'll just say select all and then i'll deselect these displacement maps now it's asking if i want to overwrite the colors because i already had those you can just say yes to all okay so here's all of my textures uh one thing you want to do every time you import a material or a group of textures into unreal there's one thing you want to change about some of these so i want to look for all the ones that say metal and roughness and i'm going to hold down ctrl and just select any one that says metal or roughness i'm going to right click on it and go to asset actions bulk edit via property matrix basically we just want to uncheck this srgb uh general principle with 3d rendering is you don't want to color correct roughness map or metalness maps so we're just going to turn it off okay so we have a lot of materials here it's going to be repetitious so i'm just going to do one and then you guys can do the rest it's just the same process for each material so i'm going to double click on the body material and we get this node based editor you can see the color map's already plugged in so that's pretty cool now a quick note about unreal 5 i can just hit ctrl space and all of my textures pop up so let's grab the other textures that are associated with my body material i'll just drag and drop those on and if you're not sure which map you're looking at if you click here you can see the name right there so this one's the emissive map i'm gonna grab rgb and drop it into a missive color this one here is roughness so i'll drop that into roughness blue one is normal map and this one's metalness or metallic every time you finish a material you always want to press save up here in the top left and then close the window so you want to do that for all the other materials there's one that's kind of unique here though if we open up the eyeball we can see that this one only comes with one map it doesn't have a roughness or normal or anything it's just the color but we do want to make it more shiny than it is by default so i need to set my roughness to zero if you're familiar with pbr rendering you know that zero roughness equals really shiny and then roughness of one equals not shiny at all so i need to plug a little zero into here so it's shiny now one thing that's kind of confusing about unreal is just understanding the terminology that it uses so instead of searching for number you know this doesn't make sense you just have to kind of learn the grammar and the terminology that they use the vocabulary and that just comes with experience and practice so i just happen to know that a number is a constant i'm going to search for a constant and just drag the zero into roughness and you'll see that the eyeball here is shiny now okay so now our character is ready to set up in the scene if i click on this little capsule with the white robot i want to switch to our character so over here where it says skeletal mesh over here in the details panel i'm going to switch from sk mannequin to the hero so now there's our character inside the capsule so if you downloaded a character and it's the wrong size here's how you would fix that navigate to the folder over here called third person bp which is short for blueprint i'm going to go into the blueprints and here's where the uh the default character lives in the folder structure if i double click on this guy uh you may or may not see a video of him just click on viewport if you don't see it let's click on him here and do the same thing i'm gonna replace the hero and now i could scale him if he's the wrong size so you can press r for scale and you can change the size of your character right here so let's actually make him a little bit bigger notice that he's snapping so i can't quite get the right size that i want so to turn off snapping you just click this little blue diagonal arrow that can make him exactly the size that i want right there and i'll hit compile and save here we go okay so now we need to get him animated because if i press play and try to run around he's just kind of floating i'm sure you guys have seen this in a game when it glitches out or maybe he's done maybe this is how you want your game to look so there's a little bit of technical stuff that has to go on here and the the thing you have to remember is that this capsule this pill-shaped thing is your character that's what the game considers to be your character and the model of the dude is just a fancy attachment so we need to measure how fast the capsule is moving and it'll tell the superhero which animation to play based on how fast the capsule is moving so i'm going to navigate to my superhero folder and i'm going to right click right here and i'm going to create two things so right click i'm going to go to animation animation blueprint and i'm going to associate this with my hero and we'll call this an mbp animation blueprint underscore hero let's create another thing here i'm going to go to right click animation blend space let's go with the hero and i'm going to call this bsp which is short for blend space hero okay so now we've got these two assets right here that's going to help the character move around i'm going to double click on my blend space there's actually a really cool window right here so you get this cool graph with the vertical axis and a horizontal axis and you can do all kinds of stuff with this but what we want to do is plug in our animations based on how fast the character is moving the vertical axis is going to be his speed from zero to his max speed and then this is the direction he's facing from left to right let's actually name that so it's easier to see because right now our axes are named none and none so if i go over here to horizontal let's change the name to direction and on vertical axis i'm going to call that speed now your character can face 360 degrees but we don't want to go from zero to 360. we want zero to be the center and then it's 180 degrees to the right and then minus 180 degrees to the left so i'll do minus 180 for the minimum and 180 degrees for the maximum so now this center line is zero degrees this is 180 degrees to the left and then same thing for the right now for the speed obviously your minimum speed is zero the maximum is 600 and that's just because the game's already set up that way it could be anything but just by default with this template it's 600 so we'll just go with that okay so here's my list of animations from before uh we'll start with what does he do when he's going zero miles per hour right here at the bottom of the graph i'm going to drag and drop my idle animation right there and you can see he just starts playing the idle animation what do i want him to do when he's going max speed in the forward direction i want him to be running so i'll drag my run direction my run animation right here and the cool thing is you can actually test this you hold down shift you can actually blend between the two animations and notice that it automatically kind of invents new animations when you're halfway in between so you don't have to worry about blending between different poses it'll do it for you it's pretty cool now it looks a little weird when he's walking slow because it's he's not really walking he's kind of half running so that's why we downloaded our walk animation in my case it's dwarf walk i've already played around with this a little bit and i know that this dwarf walk looks best at about 150 so this is zero 150 300 and so on but you can experiment by moving it up and down and seeing where it looks best so there's a nice confident walk animation and if he goes faster he starts running this is actually the bare minimum you need so let me show you how to get this working in the scene if that's all you need you could actually stop the video there or just watch to learn but once i get him walking in the scene i'll come back and i'll add all these other animations so let's hit save and i'm going to go into the animation blueprint now so the cool thing about unreal engine is you can code your game without having to know a single line of code it's a visual scripting program called blueprints so it's technically based on c plus plus but you don't have to know any of it this is going to seem really technical but if you just follow step by step it should work so this node right here if you think of the whole thing as like a big math problem this is the answer we have to write the math equation before it so the computer can determine which pose you should be doing at any given time so i'm going to create something called a state machine if you press tab you can search i'm just going to type in state machine and i'll drop and plug it into there cool let's actually name the state machine let's call it hero state machine okay i'm going to double click into the state machine so pay attention to this top bar because we're getting nested deeper and deeper into these nodes so the state machine is think of it like a flowchart entry means when you press play your character is going to go from the entry into the game into a state so if you drag and drop this into nothing it brings up the search i'm going to say add state and i'm going to type idle walk run so basically my character can only be in one state if i double click into here see how we're nesting deeper and deeper into these nodes i'm going to grab over here in my asset browser i'm going to grab my blend space this is what we just set up earlier let's drop it right there and plug it in and press compile so now you can see he's idling so the way this works is if i say my character's going let's say 300 units per second and then press compile he starts walking if i type in 600 and press compile now he's running now it's not a very fun game to have the player pause it every time they want to change the character's speed and type in a number we need to create some logic so that the the capsule is always updating at every single moment in time to tell the computer how fast he's running and it'll update the animation in real time so to do that i'm going to go over to the event graph so i'm going to create another little flowchart here so remember what i said earlier the capsule is the character and the dude inside is just art the charac the game doesn't really care about that the capsule is the character so right now we're in the brain of our animation our model and we need to tell it to look at the capsule and and figure out what it's doing so i'm going to go drag this pin out into empty space and i'm going to search for cast to third person character remember earlier i said if you use a different template like the top down character it would be different this is one of those times where you need to change what you type so if you're doing the top down template you would do cast a top down character now the object is going to be get player character right there so this right here is the capsule we just called the capsule and said hey superhero man pay attention to what the capsule's doing and remember what our goal here is to come up with two numbers which is direction and speed so right here as the third person character i'm going to drag this blue pin out and search for get velocity right there and also get actor rotation perfect so you might think we're done remember we're looking for speed and direction and you look here and you say velocity is speed and rotation is direction so we're done right kind of velocity means speed kind of in everyday terminology but in math it means how fast you're going and which direction and so we need to kind of separate those two numbers out so here's how we do that i'm going to drag this out i'm going to search for vector length which is super smart science talk for speed and then i'm also going to go calculate direction perfect let's just plug this little purple dude into that purple dude and we're actually done i know that was really more technical than we usually go but hey it's necessary if we want to fight crime so we've done the math now we just need to tell it to give us the answer so if i grab this green one i'm going to go promote to variable which is just a number a variable is just a number and i'll name this speed and this one is direction so i'm going to promote to variable and call it direction quick tip about blueprints if you ever see a node here with these little home plate little icons it needs to have something plugged into it or it won't work what you do is you just scroll back to the last one that has an execution pin and you just plug it into the next one and you can just string them together it almost doesn't matter what order they're in at this point just as long as they're plugged into something so i'm going to hit compile and save i'm going to go back to my idle walk run tab and we've done the math we just need to plug it in here so notice down here i have these two new things called variables speed and direction i'm going to grab this say get speed and plug it in here so this little node is all of that math condensed down into one little icon and it's going to constantly update and tell the computer what the character is doing i'm going to hit compile and save so he should work now let's close this window okay last step before we can press play is to click on our character go to the anim class and choose our nmvp hero our animation blueprint hero and you can see he goes into the ready position when i press play and start walking he animates so that's all you really need that's the bare minimum i'm going to go a little bit more advanced and show you how to do the sideways animation right now so if we go back into our content double click on blend space hero remember this graph this is the speed vertically well we have the direction axis right here so i have the run forward at the top let's put the run left right here on the left at the top and i'll put run right and then down here we have the walking speed let's do walk left and walk right and then you want to put the backwards direction on both outside ends so here's a run backwards here at the top and walk backwards and i'll do the same thing on the other side if you hold down shift you can test it out so if i go vertically he's going to walk forwards and then if i go to the left you can see he's going to start running to the left i go to the right he goes to the right and then if i go downward he starts slowing down but he's still walking to the right so you get this really cool graph where you can make your character run in any direction so always press save when you're done let's close the window and if i press play you might see that it doesn't feel any different he doesn't really run sideways that's because right now the character is set up to always turn the direction that he's moving but we can change it so that he always faces the direction that your camera is facing so if i do this he'll be facing forward but running sideways so let's do that really quick it's really simple i'm going to click on him and then over here you scroll way down i usually scroll down until i see these three boxes in a row but if you want to double check its character movement rotation settings where it says use controller desired rotation i'll turn that on and then i'll turn the orient rotation off and press play so now he always faces the camera and then he'll run sideways or run backwards so let's do two more things you notice that he can't really slow down so what was the point of getting those walk animations let's create a button that will make him slow down and walk and let's also create a button that will make him jump if i go back to my content browser i'm going to search for the third person bp folder into the blueprints folder and here's the brain of our character this is where the blueprint lives let's double click on that so this is where we were before when we changed our character's size if we go to the event graph this looks really complex you can just kind of ignore all this this is the brain of the character that helps them move what we're going to do is scroll down to the bottom of this graph just to ignore all this stuff and we're going to create two new buttons i'm going to right click and search for right mouse so what this is this red note here is called an event the event is when the player presses the right mouse button something happens when they let go of the right mouse button something else will happen what i want him to do is slow down to his walking speed which is kind of arbitrary but i picked 150. so i'm going to go drag this out and what you want to look for is set max walk speed if you don't see it pop up there's this little safety check box called context sensitive it helps prevent you from plugging in things that don't go together but i'm just going to uncheck that because i like to live on the wild side and here's set max walk speed right here so when i press the right mouse button i want to set my walk speed to 150 and when i release it i want to set it back to 600 which is the default now we have a problem we set max walk speed but it doesn't know which character should be changing because there could be multiple characters so we need a target that's really simple it's right here just drag character movement and plug that into the target for both of them and that's it that'll make him slow down let's press compile and save and i'll press play so now he runs but if i hold down the right mouse button he slows down to his walk speed when i let go he goes back up to his run speed which is pretty cool but now we have one last problem we need to solve when i press spacebar to jump he plays the walk animation and that's because he's technically increasing and decreasing in speed right so we need to do something else for the jump let's go into our content browser i'm going to go to my superhero folder back into my animation blueprint and i'm going to go into the event graph and this is what we just did remember we this is where we determined speed and direction i'm going to determine one more thing and that's is the character falling you just grab this blue pin and just type is falling so now it's it's a binary checkbox is he in the air or is he not in the air it'll return true if he's in the air it'll return false if he's not so let's create a little checkbox that changes automatically i'm going to go drag this red one out drop it in empty space and click promote to variable now we did that before and it was green but now it's red so the difference is the green ones are called floats which is just a fancy word for a number could be any number the red ones are just true false statements is it true or not true so that's how that's why it's a different color i'm going to hit compile and let's name this jump or jumping with a question mark i like to make it a question mark so i know it's a true or false statement and we'll compile that notice that if i click on this by default it's not checked because he's he starts on the ground right so we'll just leave it default false but if the character's in the air it will automatically become true and we can make him jump oh wait you know what i almost forgot the important rule i mentioned see this node has the little input it needs to be strung together compile save let's go back to our idle walk run and let's go back to our hero state machine and we're going to create a new state which is a jumping state i actually have that jumping animation that i downloaded it's actually a falling animation and i'll drag and drop that out and call it jump state you enter the game he immediately goes into the idle walk run and when i press spacebar i want him to be able to go into the jump state so we need to create a path from here to here and this is the rule that allows it to go into that state and we're going to use that is it falling to let it go into the jump state so i'll double click here and remember whenever you create one of those variables it's accessible right here so here's my jumping variable jumping with the question mark drop it let's get jumping and you could just plug it straight in but that can cause problems so i'm gonna do a little uh equals and plug that in so if jumping is equal to true then you can go into the jump state let's press compile and save and we'll press play so he moves around just fine when he jumps he jumps but notice he doesn't go back into the walking state he just kind of does this which is kind of cool but not what we want i think our players would probably complain that they paid 60 for this game and he doesn't even run around right so let's fix that and then we'll be done go back into your animation blueprint and i'm going to go back into my state machine right here so we have a rule that lets him go into jump state but he can't go back so let's do the exact opposite drag it back here double click on the rule here's my jumping node let's get jumping search for equal and plug it into here so if jumping is equal to not true this empty box means not true then you can go back into the walking state and let's press play so he jumps and then he walks again which is pretty cool so we have this character with some complex movement you can walk he can run he can jump and just as a quick teaser notice these hallways i've already got these loaded into the scene these are actually from the store if you go to render crate and you search for sci-fi hallway or sci-fi corridors you'll see these we're actually currently in the process of getting them set up to run in unreal engine just by default you'll notice they actually have functionality the doors open and close the lights turn green and it'll close behind me and some of them even have smoke and fire and cool effects like that so look out in the future for that so that's it i know it's pretty complex and it was our first unreal video so it might have been a little bit too much information to throw at you guys at once so if you don't even want to do all that we're actually going to put this finished character on the store for you to download you can just drop it into unreal you don't have to do any of that work if you don't want to let us know if you want more unreal engine content in the comments and let us know if you're more interested in using unreal for game development or for doing short films and cinematics and virtual production and that sort of thing so if you end up downloading one of our characters and getting it working in unreal engine don't forget to go over to our new discord and we actually have an unreal engine channel and show us what you've got and make it awesome [Music] [Applause] [Music] you
Info
Channel: ProductionCrate
Views: 72,761
Rating: undefined out of 5
Keywords: motiondesign, motiongraphics, aftereffects, compositor, visualeffects, adobeaftereffects, motiongraphicsartist, motiondesigne, postproduction, videoediting, videoeditor, filmmaking, filmmaker, production crate, productioncrate, footagecrate, footage, crate, Stock footage, free stock footage, adobe, After effects, adobe after effects, special effects, vfx, visual effects, fx, tutorial, tutorials, hitfilm, hit film, hit, film, unreal engine, unreal engine 5, unreal engine v, ue5, uev, unreal engine animation
Id: q-nxHRPyee0
Channel Id: undefined
Length: 24min 27sec (1467 seconds)
Published: Sat Aug 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.