Unreal Engine 5 - How to Use Camera Animations in gameplay

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] this video will be about creating a simple system to play camera animations and gameplay and how to create those camera animations using the Unreal Engine sequencer we'll start off by creating events and an actor to play the camera animations as for the project we'll just be using the basic third person templates uh that unreal Legend provides out of the box um and technically you can create the camera animation without using any character animation but I'd advise I would think it's a better idea to have some sort of character animation to play while you're playing the camera animation just so you can kind of have more fun editing it and actually see it work as intended in a more close to actual production environment so to say and so I'll be using an animation I got off from the marketplace inside of Unreal Engine and once you've got your animation setup let's dive into actually implementing the feature of camera animations [Music] so first we're going to be creating an actor to play our camera animations uh in the game we're going to call it BP camera animation player and inside this actor we'll be adding a camera component compile uh We're Not Gonna delete those so we'll get rid of those and before first going to create we are first going to create an event called play camera animation and from here we're going to get the gameplay camera subsystem this is the one year you should be interested in from here we can get a camera animation uh take some input of the target which is the gameplay camera subsystem the player controller which you can get using get their controller and also the sequence that we're intending to play which we do not have yet because we haven't created it and once that's set um let's just say we wanted to play it from the player character I'll just I just have the player character take the input of K that's going to play an animation montage and then it's going to spawn the camera animation player and fires off the event for it to play camera animation um once that's set let's go back to the camera animation player blueprint and even if the camera animation is playing if the view Target is still set to the camera attached to the player you wouldn't be able to see the works of the sequence you're playing so you'll need to add a set view Target with blend node and set the view new new view Target for it as itself which is BP camera animation player then when the camera animation is playing on the camera inside of this particular blueprint um and you set the view Target to that that's when you'll be able to see their camera anime the perspective in the camera animation you just need to set the view Target to the camera attached to this blueprint actor and then obviously we have a play camera animation we also we're also going to need a finisher and Camera animation and here we have to set the view Target back to the default player camera which is attached to the third person character so we can come back to our player character's perspective once the camera animation has stopped playing and since we're playing this camera animation after responding it and firing at a custom event we don't want to forget about destroying it because we don't want to have another camera another Another One of These Blueprints in the world stacking up again and again whenever we play the camera animation and don't forget to add Stop Camera animation node when when you want the camera animation to stop or else it's going to keep on playing the animation even though the view Target is going back to the clear camera and it kind of messes things up and now we'll be creating the camera animation itself we'll be using the level sequencer and the camera animation sequence which can be used as a template sequence for a camera animation um you can just bring up a new level or in my case I just cleaned up the third person map a little bit and started adding the things I needed to work on my camera animation so first off we'll need to create the level sequence uh asset so we'll have a level sequence where we have the player character so we can see it doing its playing its animation character animation and we can animate the camera animation around the player character while it's doing its attacks attack animations once you have the level sequence set up drag and drop the character you want to work with after you've dropped it inside the level remember to zero out on the location and the rotation and if Force for any reason you're using scale also set it to the default value you'd like it to be if you're also using the default annual engine mannequin once you drop it down inside the track it's going to show up some control rigs that are already active for this video's purpose we're not really going to work on you we're not going to be using them so you can just mute them on probably just get rid of them too so um once you've set up the basic character and the kind of the control room you can make let's add an animation for it to play so you can click on the character mesh go to animations select the animation you want to play well in my case I'm just gonna play a combo attack number three like so and for this we're going to make a camera animation for this move set so for this move so it's gonna do like a twirl and then some shots we're gonna make an animation for that you're going to need a camera animation sequence which is you can find by right clicking on the asset browser to create assets go to cinematics and then go to camera animation sequence camera animation sequence uh let's just call it my animation so now we don't have anything yet but before we actually work on this we're just going to go back to the level sequence and add a camera so we can actually see how our animation is working so here you can see a camera button got a camera it's going to start off in the location of the camera inside the viewport I'm just gonna zero it out and then here on the camera actor on since go to track and then here this is something I was working on before and here the one you've created my animation camera animation sequence I'm gonna add that there cool thing is once it's inside the level sequence and we have the camera animation here as a template animation you can just double click on this and work on it as right here on like while we're watching while we're looking at the animation um we're going to be working on the a transforms first so let's I mean let's say we want to start off here we're gonna add a key there key here oh before we actually do that let's just get rid of the transfer here because that transform also has an effect on the animation itself we just wanna focus on just worry about the animation itself right here if we have the transform outside of the character the animation itself let's say we're moving 50 inside this my animation asset and then another 50 inside the level sequence here it's going to all get messed up right so that's why we want to have everything just just zeroed out inside the level sequence and then we'll and then work on the camera animation from there so here let's say we do that we start here and then he does something when he does a twirl we we close up and then when he goes up again we kind of go up and then when he comes back we finish off to uh the original position where we started from so here we can see you can click on the camera just to see how it goes close here and then goes back as we wanted to problem here is we're using a cine camera so let's actually go inside the game actually you can press this to unpossess um let's go back to our third fiction character we're going to be choosing the animation we created my animation and then here I'm just gonna make it play yeah never mind that uh here we're gonna play it so oh yeah I added the particles in the sound so uh just forget about that so the thing is here like you can actually see it moving as we intended but the problem is that we were working on the cine camera actors viewport so it has like all these functions that the normal camera does not have so like look at here if you look at the properties like we have a lot of uh properties here that this default camera does not have like lens settings Focus settings Focus method prop settings Etc so that's why when you try to look at it I work on it we're getting something that we're getting it from a point of view that we're not really uh that's not really accurate to the game let's say we want to have everything played inside of the gameplay camera which is this blue one so I one thing I've tried was just try to change the class here you know just the camera actor and sometimes it just works like that but sometimes uh I don't know if it's a bug or anything but sometimes I have to place a camera actor inside the level and then change the class and then it works but sometimes it just works like that so here we have it uh that's something's not working it's not playing this uh before we do anything any anymore camera we're just gonna name it so it's less confusing just check it's a camera actor get rid of all these uh keys I mean properties I mean these properties oh I can't even uh undo them but yeah the properties I just uh deleted they're properties that the default camera cannot have like they it just straight up doesn't have so here we have the animation it's still there because it's basically just transform keyframes right now we can see it in a more uh close to actual gameplay perspective so if we take a look we can kind of see the whole body here and then when you move in I'm just kind of just like that in like that let's say over here we want to go to the left I'm going to use auto key on it's already on for me probably most of you it's probably I'd set up none I've been messing around with the project a little bit so I have it on AutoCAD is really um convenient for just blocking out quickly blocking out frames right so here if I just go to this Frame then I do this it automatically Keys it to that frame to the transform I already had so goes here let's say we kind of turn it a little down here and goes back so if we have one where it starts at the back goes to the left of the character and then comes back to the back we save go to gameplay and then Play It Again so at a full screen we can see that it's playing the animation of the character and also the animation of the camera and it's really easy to just edit things while you're on the Fly soon so here um where is it if you go back go back to the level sequencer and go and see here that it's yeah the animation sometimes gets messed up when you're going back and forth through the level sequencer and the gameplay I found out that you can just reload the level to fix this so if we just go back here third person map then be if you reopen the sequence level sequence it just goes back to normal again so yes this is basically the gist of it if you're going to be using a cine camera actor for your animations like you want you might also want to consider using uh what was it yeah the camera here you might want to consider using this as a center camera too right this one but uh I just wanted to go with something more a basic more of uh something that we're more familiar with so I just wanted to use the basic uh gameplay camera and also animated in the perspective of the gameplay camera there might be some little uh differences between this animation that's actually edited and the actual gameplay but just for as a starting point for people who who've been figuring out how to actually gets a camera animation going and playing inside the game and also how to edit it I think these information would have been pretty helpful foreign
Info
Channel: gotagamee
Views: 12,968
Rating: undefined out of 5
Keywords:
Id: Aak3EiyiGE4
Channel Id: undefined
Length: 16min 39sec (999 seconds)
Published: Mon Sep 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.