*NEW* How to Use Motion Matching in Unreal Engine 5.4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial today I am going to show you how to use motion matching in unre engine 5.4 preview it's going to be a very easy view to follow so let's get started all right so the first thing we need to do is enable the motion matching plugins so let's go up into edit plugins and the first one is going to be motion trajectory let's go ahead and click enable and a warning will pop up saying that it is in experimental we're going to say yes and now we need another one which is going to be the post search so let's go ahead and enable this two with those two enabled we can now go ahead and restart to apply this plugins to the editor okay so now the plugins are enabled as I have restarted the edor so before starting to set up motion matching in this spread what I want to do is import more animations because right now for our third person template what I have is this limited run forward and this idle animation and also this walk right which is basically very limited for a motion matching we want to go ahead and move Left Right forwards backwards and also a j start and a jck stop so for this you're going to be taking advantage of Lyra if you don't know Lyra Lyra is a demo PR that epic games launch a bit more than a year ago which basically includes a shter template and it comes with this really cool jug animations for our Locomotion which we will uh basically use now it is free and I will link it in description from the marketplace so just go ahead andate create a li plate in 5.3 now once we have it opened in 5.3 what we're going to do is basically go into the characters folder go into Heroes go into mannequin go into animations and then Locomo and then unarmed and here we have all of our animations that we will basically be using so let's go ahead and filter by animation sequence right so we only see the animation Clips itself now let's go ahead and select all of them right click go to ask actions and click on my grade now this will basically copy and paste all of the animations that we will need to our motion matching PR in this case I didn't make any change going to say don't save and it will automatically select all the dependencies from this animations that means the character too now in this case this skeleton is the same one as the one in the third person template but you know we directly also migrate the character things will be easier for us so let's go ahead and click okay and then we need to navigate to our Pro for motion matching in this case this is my PR so let's go and enter in the content folder and now that we are in the content folder we can just go and select this folder and now it will basically migrate all the assets from this print to our motion matching print and after a few seconds there we go we can now go back to our one over here so now if we go to characters we can see a new folder which is Heroes which contains The Locomotion for unarmed which is really cool all right so now with those extra animations imported it is time to begin to create the assets for motion matching so the first one that we will need will be a post search schema so let's go and select the content browser just right click go to the animation section and now with this new plugins we can see that we have another new section which is motion matching so now with this we can create a post search schema now let's go ahead and select the SK manum which is blue which comes from the lra template okay and now let's go ah and name this something as pssor motion matching all right so let's open this up so what does this asset do well basically it will um set all the parameters that our animation database which we'll create a bit later we'll need for the decisions like angle velocity Etc now there's a very limited documentation in this right so we're going to be leaving everything by default which will work just fine for our testings okay if in the future want an more detailed tutoral on this I can make one so let me down uh in the comments All right so now with that asset created it is time to create another asset which will be our post search database which will basically link with this and it will contain all the animations that our motion matching database will have so let's go ahead and right click go to animation motion matching and create the post search database let's go ahead and select the PSS that we just created and now let's go ahead and name this something as PSD _ motion matching and let's open this up all right so now in here what we can do is dragging all the animations that we will need for our uh Locomotion now before doing that let's make sure that all of our animations are using root motion this is very important because motion aing will use rot motion so let's go to characters heroes mannequin animations Locomotion and AR go with contr a select everything right click go to S actions and select edit selection in property Matrix this will allow us to change some of the parameters of all the animations at once so if we go ahead and press contr a once again we can go to root motion and enable root motion right now it has this dge which means that some of the animations have root motion enabled and some others not so we disable this we can enable it back again and now all of them have it and the same with force with lock we go ahead and disable this and enable this now all them have it let's save and now the animations will have rot motion which is essential now let's close this go back to our database press control space to open up the content browser and now let's drag in all the animations that we will need so in this case this will be on characters heroes mannequins animations Locomotion unarmed and now let's go ahead and search for jck in this case let's begin by going forward so FWD jug forward drag it here then for backward bwd this one here then we will basically contain the uh going uh left so left direct this one here then also going right we'll get this one then we will also go ahead and get for the idle animation which will be this ready and then we also require some uh start and stop so it will basically be even smoother so let's search for jog start and direct this one over here for back backwards forwards left and right and then also for stop and we'll do exactly the same thing so from left to right over here there we go cool save and now if we go and select all of these animations we can see them in action in all the directions which is really really cool so now the only thing we need to do is apply this database to an animation blueprint which is going to be very very simple it will only require literally two notes so let's go back to our content browser right click create an animation blueprint if I know how to click correctly there we go now let's go ahead and once again select the S mannequin which is the blue one coming from Heroes which is the one from Lyra hit create ABP uncore and this will be just motion matching let's go ahead and open this up and now what we can do is add the following two notes the first one will basically be motion matching itself so search for motion matching and apply the this node now this node will basically require a database which is the one that we just created which is BSD motion managing so let's go ahead and select this and now we can leave everything by default and then the next note that we will need will be the Post history okay now this post history will require a uh trajectory now the trajectory is a component that now we need to add to our character blueprint so let's go to our third person folder Blueprints and open up third person character and here let's go and search for um trajectory and this will be character trajectory with that said we can now compile save and this component will basically get the direction of the player and gets its trory and all that information that our motion matching database and uh everything we need so now we need to pass it over here so we need to grab that information from this uh blueprint so we need to do this on the bencraft now to save performance I'm going to go ahead and just add an initialize animation which will occur at the beginning so when the game starts I will basically cast from the owner to the uh third person character blueprint and I will save this in a variable okay so let's right click promote variable and name this something as third person character BP good with that now in the update right on every frame we will access this third person character and get the character trory component that we just basically added okay and basically the only thing we need to do is right click and promote this to a variable and that's it okay so in the update we'll constantly be filling this up now the reason that I did this on the initialized right the casting is because casting uh is pretty U performance intensive when we do it on the update uh not really but if we do this for example in a multiplayer game with a lot of Pawns and so on it will basically just reduce performance and there's no reason for this so let's have it on the up on the initialize and then on the update we can just at the Save variable and use the information that we need cool so now in the name graph we can just right click on this trory input go to binding select the character trory trajectory and now we have it binded so it's basically using that one that we just assigned so now the only thing left to do is to go to the third person character select the mes change it to our uh Queen from lra which is really the same skeleton so really you could use the other Queen okay there's no problem with that and then of course select the animation blueprint that we created which is AP motion managing with that said now we can go and press play and we will have a error what is this well that's because Lyra also migrated some footsteps now the footsteps have missing references and everything like that so I'm going to go ahead and disable this disable this and also if we select the first uh error here it will bring us to the section where we can disable this compile and that's it would have any errors okay go ahead and contr shift s and everything saved let's go ahead and press play and now when I go ahead and move you can see that we are actually going ahead and moving with motion matching which is really cool with stop uh start and stop animations and everything like that now to basically represent motion matching in it you know Peak um happiness we going to go ahead and change the direction movement of the player so let's go to the character movement component go down into the rotation settings and let's go ahead and disable AR rent rotation to movement and enable the side rotation this will basically move the player whenever it is looking which allows us to have a strafe movement where we can go left right backwards and forwards and that's it now we have motion matching working in our PR now one last thing to you know go ahead and kind of debug this motion matching is that if we go down here and go ahead and search for character trajectory and we have this a character trajectory debug we can now just put a space one and now we can basically preview this trajectory going ahead and happen it there you go so that's it guys if you found this to helpful I would really appreciate it you can like video And subscribe to my channel iot of unine videos and tutorial so check them out we might have full access to files through Pat or YouTube members join my Discord server follow me on socials and now just with all said byebye [Music]
Info
Channel: Gorka Games
Views: 49,724
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, ue 5.4, tutorial, quixel, megascans, unreal engine 5.4 motion matching, unreal engine 5.4 motion matching tutorial, ue5.4, ue5.4 motion matching animations tutorial, ue5.4 motion matching with animations, unreal engine 5.4 preview motion matching anims, unreal engine motion matching database preview 5.4, unreal engine 5.4 motion matching with mannequin preview
Id: S4aBd64t-hY
Channel Id: undefined
Length: 11min 57sec (717 seconds)
Published: Sat Apr 20 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.