Create a 2.5d Sidescroller in Unreal Engine Part 2 (Animations)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] guys so um part one uh we looked at uh changing the camera into a 2.5d side scroller angle um we also set up a functional health bar which we walk through a damage test take away half our health go to our health pickup and it would increase our health back up full so in this video I did talk about uh using mixo um in order to um let's just get that going you can see I don't really prepare um with these a lot I just sort of wing it and go with a flow which probably in a sense has taken me longer sometimes cuz I do um record videos and then they don't work which is really annoying but I think that's my internet connection but anyway that's besides the point what we're going to do today is we're going to bring in a character and set up an animation blend space with animation blueprint for those of you that don't know this is a free website from Adobe which is pretty pretty pretty awesome because uh it's free and it has a library of animations and some character meshes and it's free okay so I'm just going to get signed in yeah did I do it right yes I'm signed in perfect okay so once you made your account we'll have a little look in the library here where it says characters and there's quite a lot to choose from okay um I'm not going to go crazy on this um I think I might just use Megan keep it simples yeah Megan looks like a trusty little mesh that'll do lovely for us okay cool um who made this can I give the who made Megan Megan Megan Megan Megan is there any okay so I don't know who made this but shout out to that person um props to you um but what we're going to do is we're going to now click on animations and we're going to start by taking the T pose animation okay that's what I like to do because we want to rig the character bring it in with no animations so just T pose click download and it will say with skin make sure that it says with skin cuz we're bringing the mesh and the rigged uh the the the character rig in together so press download cool and then we want to go back to animations and we're going to get an idle animation so an animation blend space is where we can blend more than one animation so um think for example you're an idle then you go to like a little bit of a walk before you start running that's three animations we can blend that into one output pose so okay so what we want to do is we want to get our idle um press enter and I'm going to select this one here and it's pretty cool I like it so we download this now every time we're going to download an animation after we've downloaded our character mesh we has to be without skin press downloads and let's get our walk and this is a bit of a I mean it's a bit of a hard man walk right but it'll do so see the way the character's walking off their space we don't want that we need to tick in place make sure the character's walking in place very important now are the hands rubbing up against the mesh little bit so I'm going to just open the character arm space a little bit like so that's better once again download without skin also going to download run animation we'll also have to take in place make sure the hands are fine that's good let's download without it's supposed to be honest like we'll be looking at it from this side because it is uh 2.5d so you know can't really see if it was the hands we're going through anyway but it's good practice do it right you know you do it the right way you do it the wrong way okay we're also going to get a jumping animation um where is it that's the jumping one going to trim the animation okay I'm going to trim this up till about 22 like so and I'm going to download it without skin and we're also going to get a death animation I like this one death and we can change the hit location so maybe around here you're going to trim off the the gun part that works for me download without skin you could play around with these values you could be here all day it's a really cool website and I just love the fact that it's free and it's from Adobe and that never really happens so what we're going to do is we're going to go over to Unreal Engine um we're going to close this one and we're going to create a new folder in the content browser so right click new folder we're going to call this main C for main character going to double click and open it up create another new folder we're going to call this one mesh we're going to create another new folder and we're going to call this anims for animations we going to double click and open up our mesh go to our file explorer wherever you downloaded your T POS there you go um where's my T POS there is my T POS so you can't bring the the rigged character and the animations in at the same time you have to bring in the rig character first like so and then and you'll get uh import option screen make sure the skeleton is none cuz we're bringing in our own skeleton click import all and that will import like so soon enough fingo you'll always get no smoothing group just close that doesn't matter go back to your main C folder open up atoms and what we're going to do is go to our file explorer and we can now bring in all of our animations at once like so and then you'll get the import options this time change the skeleton to T pose that's what we've just called that's what we've just downloaded that's our new skeleton it's there now the animations know that they're they're targeted up to that skeleton import all like so and then one thing I'm going to do which I didn't mention in my last video it's very very important to always be saving okay so like a five minute save rule so control shift s to save the whole project cuz unreal likes to crash and it's a bloody nuisance so right click in your content browser again go to animation scroll down to the bottom where it says Legacy go to blend space 1D select your skeleton TST we'll call this main camore BS for blend space and then right click again go back to animation and go to animation blueprint select the toost skeleton and then call this main C uh animore BP for animation blueprints cool so what we're going to do now is we are going to open up our animation blend space and we're going to put this together cool so on the left hand side it says horizontal axis click on little arrow change the name from none to speed cuz it's going to be our speed and the maximum access value I believe is 500 it's in the character movement section in the third person blueprint um character blueprint you can change this to whatever but I think it's already set to 500 press enter then on the right hand side in the aset browser you have all your animations so we want to take our Idol and I want to drop it over here on the green ax hold down shift to align it correctly and let go and the character should go into an idle position then we'll get our walk and we'll drop it over here around the second bar like so and we'll get running and we'll drop it here at the end okay now to explain what the blend space does is we put three animations here along okay in the preview Point hold down control and just hover over from idle over to your walk and then she starts to take off into her running position and that's where we've Blended three animations into one very very simple press save close it we shouldn't need it again if you've done it right double click to open up your animation blend SP or blueprint and let's put it all together so what we're going to do is right click and we're going to type in state machine oh there we go just join these up well we can call this movement and I'm going to join it up to the result double click on this drag off the entry code and you'll get three different options here add is what we want we'll call this loo motion loo mastera double click to open this up and you'll see on the right hand side in the asset browser we've got our blend space which is usually orange drop it on top of the result like so and press compile it's still not ready yet we need to create a variable for our speed very easy to do go to the event graph and you've got these two nodes here you're going to drag off the return value type in third to cast the third person character like so and then what we're going to do is we're going to drag off here and we are going to type in is no sorry we're going to drag off the third person character we're going to promote this to a variable first of all okay so that means all the all the variables that we've created in our third person character is stored here now in a variable for animation blueprint might not make sense now it will eventually okay so drag off here and type in is valids it's the one down the bottom with a question mark like so join the blue join the blue up to the blue and we basically what we're going to do is drag our variable that we just created bring it over here and we're going to get it I'm going to drag off and we are going to get velocity if I could Spell correctly scroll down to the bottom get velocity I'm going to change this to a float by dragging off return value typing in Vector length and we're going to promote this to a variable like so and we're going to go in the details panel and name this speed press enter bring it up here and we're going to oh we're going to do join it up to the is valid going to press compile going to go back to our animation graph um with Locomotion State over on the left we've created our variable speed I'm going to drag it on top of this speed we're going to press compile and we're going to minimize that for now because we're going to go back in there and do jumping and death later on well jumping anyway um so yeah we want to go back into our character blueprints so third person blueprints bpor third person character we're going to go to our viewport over on the right it says mesh click on the Arrow we're going to choose our toost there's Megan's in the game good for Megan but she's in her toost so see where it says animation animation mode leave as is go to anom class main C anomor BP and there we go we'll press compile just prepareing some shaders there we're going to minimize that we're going to press play and she should be in the game like so Happy Days press f11 to get a full screen and we're going to take off like so there's our health our player is now in the game it's that easy now if we go to jump there's no jump animation yet and that's what we're going to do now we're going to set up our jump animation so press escap uh press escape f11 and we're going to go back into our animation blueprint okay so we're going to go back to our Locomotion um State yes here and we're going to drag off from the white um border I guess add another state I'm I'm just going to call this jump now there's all different ways of doing this this is the quick easy basic prototype and way to do this okay so we'll double click and we'll open jump we'll look over here for jumping animation we'll drop it on the result like so we'll press compile and we're going to get a few errors here which we're going to fix press compile um got some errors Locomotion to jump will never be taken we need to enter a transitional rule click on this um no don't click on that sorry uh go back to the movement all right and you'll see here this is the transitional rule but we need to create a variable first so we go back to our vent graph and from our um BP third person character um variable we want to drag off here and we want to type in is falling and you'll see character movement like so let tidy this up all right we're going to promote that to a variable we're going to call it let's call it C jump question mark press enter and join these up like so so just quick one come off the third person character variable grab um is falling character movement promote to a variable call a can jump press compile you still have your errors you go back to your um movement and this is your transitional rule so basically what we're saying is if we're in our um blend space so our idle Walker run position and we press the jump button we want to be able to tell the engine that the mesh can play the jump animation so double click on the transitional rule grab your can jump variable that you've just created get can jump drag off type in the equals key so you get equal Boolean you tick it to be true and then you join these up and we're going to copy and paste the first two so contrl C to copy go back and then bring an arrow from jump all the way back to locom motion basically saying now that we've jumped we want to tell the player to go back to our idle position our idle walk run okay double click contrl +v to paste only untick it this time and then press compile let's go test this baby out so press play I'll do a full screen with f11 again and let's give it a whirl there you go okay the job animation isn't that clean there is another way to do it but for prototyping purposes this is what we're doing so there's our jump she lands a bit too much we can fix that at the end of the day um her jump height is actually been enhanced to a th000 but this works for now okay so that's what we've got um now what I want to do is I want to set up death which sounds really really horrible right um and the way we're going to do that is uh we press 11 we're going to go back into our content browser we're going to click on our damage test and we're going to set up a condition so that's a branch a branch is a condition okay so hold down the b key like so and left click and you'll get a branch and what we want to do is we basically want to um we want to get player health so get player health and we want to type in less or equal to zero so if our player's health is zero or less than zero we want to play an animation so one second we want to we want to play an animation Montage play anim Montage which I'm going to set up in a minute we haven't set it up yet so true okay so it's a bit messy in here we'll tidy it up you can double click to add this just oh oops there you go there you go cool so that's a bit tidier all right um so basically what you're doing is you creating player Health if the value is zero or less than is a condition if it's true we want to play an animation Montage which we're going to set up now so we are going to go back to our content browser go to the MC folder going to go to animations and we're going to go to death we're going to right click and we're going to create anim Montage we'll just call this death one why not double click to open it up and we want to change a value here one second blend out blend time blend trigger enable auto blend we're going to turn up off okay and we're going to press save and we are going to go to our animation blueprint want to go to our anim graph and we're going to this is very important animation montages will not work if you don't add a default so a slot default slot like so and then press compile and let's see if it works so press 11 f11 take away our health let's go back into to it didn't oh my bad guys my bad told you I just wing it um okay so we got to go back into our um blueprint for the damage test and we got to select the animation Montage which is death one cuz we've created that press compile minimize press play and f11 Bingo and then boom our player's dead de just like that okay let's do it again so [Music] um so we go in let's get some more Health we'll go back into this twice just at the edge and then Player dead okay guys so in this video we looked at animation blend spaces animation blueprints we set up different variables like a Boolean is true or false we also looked at branches cuz they're conditions so if if the Health was zero or less than zero there was a condition and if it was true the player would play the animation montage and kill the player okay so that'll do is for this part and for the next video we're going to look at setting up some enemy Ai and um I think it's probably best we start putting in some character abilities as well like I don't know maybe some like um super speed and maybe a big jump or something like that you know has an ability meter and we need to set something up like that but yeah um as I say in all my videos leave a comment in the comment section if needs be hope you get on well with this video it's pretty straightforward um please like And subscribe it really really helps me to make more and more of these I want to keep doing it for you guys and also for my students and um yeah good luck in your game da journey and have a good one take it [Music] easy
Info
Channel: Brianko Games
Views: 6,016
Rating: undefined out of 5
Keywords: Unreal Engine, Unreal Engine 5, Unreal, Unreal Engine 5 tutorial, Sidescroller, gamer, game design, game dev, animations
Id: YCKhKlYLNNU
Channel Id: undefined
Length: 20min 27sec (1227 seconds)
Published: Mon Oct 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.