Unreal Engine 5 Tutorial - Third Person Camera Setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and Welcome to our tutorial today looking at a third person camera setup for an action adventure game or a third person shooter now these cameras typically have their own sets of rules and the default camera as good as it is can be improved so I'm going to go through and show you how you can improve your third person camera setup for your third person action game so let's get started and take a look so we're getting started here in the third person template blue there's nothing in here it's all completely default that you get when you run uh unal engine the first time and what we're going to do is we're going to fix this camera so it's more suited for a third person action game like a Gears of War or an Uncharted type game so we're going to include a few things so we're going to try and fix the over the shoulder look we're going to add in strafing and we're going to add some little touches to improve quality of life when it comes to this camera so this is fortunately very easy to do all it does come down to is understanding how the camera rotations actually work on your character so let's go through and explain what's going on on our third person character so the character when it loads up is got a spring arm which has a camera attached to it if I go to the viewport you can see these there's my spring arm and there's my camera now a few things that set up a third person character you want to make sure that on the class defaults if you want to search in the details for your ya AG W you want to make sure use controller rotation your is turned off what this will do if it is left on cuz it is on by default um is a it will make the character one: one match the control rotation and some people often ask me what is control rotation Well Control rotation is a rotation your controller is aiming currently at so when you turn your mouse or turn your thumb sticks that is changing the control rotation and so basically there's that rotation there which we can manipulate and pardon the upon control to manipulate which way the character is moving and if you have this ticket on it basically means the C is going to match it one to one with no delay in it whatsoever so this is usually turned on for first person games so if you doing third person turn that off and also similarly for NPCs or AI enemies whatever you want to turn that off as well so now we're on to the actual spring arm itself now if you go to the spring arm for the camera boom and we clear the search details if I scroll down you'll see by uh default with this uh template they've given you the used porn control rotation is turned on what that is doing then is it's telling this spring arm to have independent control away from the character using the control rotation so as the control rotation changes as does the rotation of this spring arm which is what you want typically for third person game if you don't have that on you have these in h pitch your and roll these would mean it will just take on whatever pitch Ro your en roll your character has currently have on their character but we want the turn use porn control rotation on and make sure it's on so next up we're going to increase our or decrease sorry our Target arm length so let's bring our Target arm length a little bit closer in bring it to 200 and next we're going to change the offsets now the reason why we change offsets is because I want the camera to be more over the shoulder look uh the problem we have with this though is if I just move the spring arm like so and play the game yes the character is on the left of the screen but as I rotate the camera around they change to the right hand side of the screen which is not what we want you want to kind of keep the character on the same place on the screen at all times so it saves this weird confusion of which way your character is facing it kind of gives this broken look uh when they start moving around so we want to avoid doing that so what you're going to do is we'll reset that back down to 0000 and then we're going to change the socket offset and we're going to put in 50 in the Y AIS for socket offset and as I do this you'll see the camera socket move okay now if you want know what the difference is between socket offset and Target offset so 15 socket offset does this and if I put 50 in the Target offset it looks the same but notice how different it is in the game so it's Target offset tar offsets there but notice it still goes from right to left to right on the screen now okay so the target which way the camera is pointing at is incorrect but if I go to the socket offset and put that back down to zero and put socket offset as 50 instead it's going to maintain that relationship between the character so character now which way I turn the character is always going to be on my left hand side of the screen now we don't usually have our character fully in frame like this we usually want to pop them up especially when we are zoomed in this close so let's go ahead and bring that up a little bit too so I'm going to go into my so offset and I'm going to change that to 40 in The Zed AIS and now if I go have a look at my game we got that going on there and that's looking a lot better so the next thing we're going to fix is this strafing issue so at the moment this character cannot do strafing because if I push right or left they just turn to match the way they're moving so we need to change that setting so if I go into my character again go to character movement and I want to scroll down on the right hand side down to the rotation settings which you'll find eventually down here there three bits to it you got rotation rate you got this tick box for use control desired rotation and you got the tick box for Orient rotation to movement as you can see Orient rotation movement is turned on and and what that means is that whichever way I'm moving it's going to rotate towards that direction at a rate of 500 unit at degrees per second so if I don't want that to happen I want it to turn that off and if instead I have the option to use controller desired rotation which means the character is going to match the rotation which way my control rotation is turned now that's all well and good but one thing to be aware of when you have both of these options is if I was to turn on both of them it would only do the Orient rotation of movement that one has priority over the top one so if you're both on you cause this this issue so for now just turn off the Orient rotation to movement and keep the controller desired rotation on and if I compile and look at that in game you can see the difference this makes so now if I push right and left you can see the character stays facing forward and they just move to the right to the left now the animations look bit juny and that's just because a default mannequin does not come with strafing animations but this is something you can do um yourselves or follow my animation videos to find that out so that's all well and good but we got this weird issue as well when I turn the camera you assume sort of spinning on the spot and I can never see the front of my character not easily anyway so one thing you may not notice that a lot of third person action games do is they'll actually change this rotation rule depending on what you're doing and so what we're going to do is we're going to turn both of these on now as I said I rotation is going to take priority so what I'm going to do is when I start moving I want to turn that one off so let's go to the event graph and on the event graph we're going to go to the movement inputs expand open my input node and I'm started here I'm going to drag out my character movement and set the Orient rotation to movement to force on started I'm then going to copy that and paste it below it plug it in my character movement and I'm going to plug this node into cancelled and completed and turn that one on so as I start moving it's going to turn that setting off and when I stop moving it's going to turn it on so what that does it gives us a really nice effect that you may not even notice happens in your games but if you look around I can now spin my camera around to get a good view of those skins I've bought with my character but if I was to push forwards I can still move and strafe like normal and this has a really nice effect where I can turn the camera around behind the character push W and that'll turn around to match whichever direction I've just pushed them towards so it's a simple change you can do to your camera but it works really really well I strongly recommend checking it out and trying out this for your third person action games so there you go you can now make your cameras far more Dynamic and more interesting for your third person action game if you like this video and want to see more of my content early before everyone else H up the patreon.com ranl where you going to take part in our creative challenges and watch all our videos early before anyone else thank you so much for watching make sure you subscribed and I'll see you next time bye everyone [Music] [Music] [Music]
Info
Channel: Ryan Laley
Views: 4,819
Rating: undefined out of 5
Keywords:
Id: k5Lcn2Kc3XI
Channel Id: undefined
Length: 9min 53sec (593 seconds)
Published: Tue Dec 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.