Create Any Camera Angle in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my name is Cason Quisenberry and today I'm going to show you several different camera angles that you can make in Unreal Engine 5 and give you the basic tools you can set up any kind of camera angle or any kind of camera system that you want okay now let's get started so the first thing we're going to go over is just the default camera system in unreal so this is the code for it and the actual default system unreal is like the classic you know third person game where you move and you can look around the mouse and determine where the character moves based on your mouse position and so the way this system works is all in this code right here so this is an input action basically what it's doing is it's passing along two values that you get from either the mouse or one of the joysticks of the controller here add controller yaw input what it's basically saying is ADD yaw input to the camera so controller is basically another word for camera in this instance and so this is adding the yaw and this is adding the pitch you might be wondering what those are so I'm just going to show the make rotator so this is like how you make a object rotate we have see the X here is what's called a roll the Y is a pitch and the Z is a yaw so if we say go to a cube over here so if we go to a cube here we can see right here that we have our X Y and Z so this is yaw it's basically just rotating if you look from its perspective it's rotating up and down and then the pitch which is our blue is just going to be rotating side to side so we actually hit play I look up and down I'm affecting the yaw I look right to left I'm fixing the pitch and that's actually just how our camera system works but say you want to make a game that's sort of in a 2.5 D style camera angle something along the little nightmares Series this is actually going to be the simplest thing that we're going to do to our camera all we're going to do is go to this node we're going to break this link and we're going to stop these values from being passed along to our camera and that's going to create a system like this so I'm moving my mouse right now you probably can't tell but I'm moving my mouse and nothing's happening I'm not looking around but when I hit W I still go forward I hit a I still go to the left I hit D I still go to the right I hit s I'm going to go backwards but I cannot affect where my character is going by moving my mouse it's purely based on the keyboard so this is more like you know a little little nightmares game where I can do some platforming let's say I want to jump on this object I go forward I can jump over here but then I can also do something like walk in front of this object or walk in front or walk behind this object uh however as you can see I'm getting some weird camera angles there so we're going to fix that in a second so the reason we get that weird Collision angle where basically the camera zooms into the players because of a certain setting that we have on our camera boom so if we go here and we select this this is also called a spring on component so if you made a system from scratch it's called a spring arm and it's renamed the camera boom in the actual default project but just so you know and basically we go here there's a setting here called a collision test now what it is it's basically going to use a certain channel to test whether the camera is clipping into an object or not so if we turn this off and we go back and we do the exact same thing where we go behind and we walk here you see there's no error we can even get as close as we want to here even zoom in right there and everything is fine now in here we can here see a more extreme example where you know it's clipping through the wall so this basically just going to allow the camera to clip through objects now this can of course create some weird art moments like seeing that shadow is kind of kind of off-putting but this is a way to do it to where you can have your camera not be affected by their objects however if we were go back to the original system that we had so let's just plug this in here to show you what that would be like without the Collision test we could do something like look go through the floor we can go through the walls so for a camera system like this you're definitely going to have Collision tests checked but for a 2.5 system it's probably better to not have that check so if you want a 2.5 D system that's all you have to do is just disconnect this and make sure the Duke Collision test is set to false you can of course also mess around with your camera you know move it up up or down and get you know the best camera angle that you want but I'll leave that up to you next let's make a top-down game like the original Legend of Zelda games and the Diablo Series so it's going to keep the exact same settings we're going to make sure this is disconnected and we're going to make sure the Collision test is checked to false now you could make it true because the camera is going to be above the player it's not going to be as big as a deal but go ahead and just leave it false because it'll probably make some things easier the next thing we're going to do is just go to our viewport here and just change our camera to be above our player so we're just going to go here we're just going to go here and I'm just going to keep it pretty tight for right now you can of course change it to look however you want let's see I'm going to try to just Center it a little better all right there we go so now if I go into a third person player and I hit that we have a top-down game where it follows the exact same movement as well however I don't like that so I'm that camera angle sorry I'm going to move it up a little bit just so it's a little easier to tell what's going on here and they're going to hit play and so now you can see you know very good top down angle as you can see the control still works so a is going to move me left D is going to move me right s is going to go down and it was going to go up so here we have you know a top down camera angle right here as you can see everything works the same of course you probably wouldn't have a top-down platform but I'm just going to show you the code works with it so here we have a jump and we can fall and we can go around all right so that's how we do that now of course you can also make the camera like a little more tilted if you want more of a stylized top down the sort of like full on top down is sort of a trend that isn't around as much it's more of like a stylized top down where it's more like an angle so let's do something like this so this is going to be more like your Diablo type Series so here we have it right there and as you can see it also still works a D S and W and we can still you know do whatever we need to do in terms of code it's not going to change the physics of anything okay so let's set up an isometric camera view sort of like Hades or death store these are you know increasingly popular camera angle in in style of game so I'm just going to set up the camera real quick okay so of course you can customize it however you want but this is going to be a good enough setup for me so here we have the camera angle however we're going to run into some issues when it comes to the actual control so here we have you know our system but if I hit W you see that we're going to go forward but that is not the traditional forward that would be in that type of game same with backwards you know the directions are just like feel a little bit off because right now in if in terms of if we were playing an actual game I'm hitting D but it feels like we're going forwards right because we'd be progressing through the level so what we're actually going to do is we're going to mess around with the controls a little bit now to fix this problem we're going to go down to this movement input right here and this works basically the exact same way as our camera input here where we're basically getting information from our our controller or whatever we're using to control the character and we're just going to be passing that along to our movement inputs but instead of being the mouse it's you know based on the wasd keys so if we double click to open this up we can see that we get certain settings here however this is not actually where the settings that we need to use are instead what we're going to do is we're going to go to this add input mapping up here to our event begin play and we're going to go to this ad mapping context we're just going to hit this little search we're going to hit this little magnifying glass here which is going to take us to this in our content browser this is you know our default input mapping so if you're using your you know your own input mapping of course do that if you're doing it to where you're just using action inputs you would do the exact same thing but you just go do project settings and go to inputs and you would just do what I'm about to do in here but I'm going to go back to the content browser I'm going to open this up as you can see here this is where our action mappings are including move so if we go down here we can see that we have you know the move here's the move Keys here wasd and if we even go down further now this can seem a bit complicated but don't worry it's not too bad so if we go to this modifier here this is actually what it's the values that it is getting and so if we go to something like s we can also see what its modifier is we can see it's the same thing but negative which is how basically we're getting this value when we're pressing W and going forward but when we want to go backwards we just add a negate to it if we go down to a we can see the same thing where instead of getting this value there just going to be negating values and we go to D there's actually going to be no modifier now this might seem a little bit complicated you don't know how to need to know how this works exactly for this you just need to know how to be able to switch these so if we go to our player you know we want our D to be our forward key right or we want when we press D we want what's happening to happen when we press W so what we're going to do is we're going to go into here we're going to find w we are just going to delete this and then we're going to go to S we're going to delete this and then from a we're going to add an element we're going to add what we just had which was this Swizzle input let's actually switch these just so it is the exact same it probably doesn't matter but it's good just to keep things consistent and then D we're going to do the same thing where we're just going to add a swizzle input so again you don't need to know the exact way that all this works but this is going to be good for us so now if we go into our third person template I hit W I go forward I hit S I go backwards I hit a I okay okay a I go backwards I hit D I go this way so we actually want to switch A and D at least for me I want to switch them so we are just going to delete this negate and then we're going to add a negate and then we're just going to have it to where you know hit W go forward we as we go backwards we hit a we go that way D we go that way and so you can of course make this however you want you can make it feel however you want to feel by by doing that that's just sort of the way that I'm going to set it up hey let's now say that you want to make a first person camera angle so of course you know there is the first person template but let's just say you wanted to have it to where you have a full mesh with your camera you know you have legs and you have arms and stuff like that uh what do you do then well it's very easy the first thing we're going to do is we're going to make sure that our camera is not parented to a spring arm anymore so we're going to de-attach that we are then going to attach it to our mesh so now it's attached to our character the next thing we're going to do is we're going to go to this parent socket and we're going to click this this is going to bring up every single socket and point of your rig so as you can see it has the default rig that's basically completely set up so I'm going to go and I'm going to hit head so now my camera is going to be attached to the head of my player so now I'm just going to set up the camera where I want it make sure that your course is in front of the head so you're not clipping through that you can also make sure that it is rotated correctly the other two things you need to make sure is you need to make sure that this information is still getting passed along so plug that in and then also when you select the camera make sure this setting is called use Pawn control rotation is selected to be true this basically just going to make it to where the camera is going to use this information to move itself so now when we have that we press play and now we have a first person camera I can look down I can see you know my body and stuff like that and now I can go over here I can jump and now we have a first person game all right so that's gonna do it for this video that's how you make basically every single camera angle you could possibly one unreal five of course you can mess around with the settings you know change the rotation of the camera change the different effects change the controls all that good stuff I just want to basically give you the basic tools so the now going forward you can mess around with your camera and really find the camera angle that works the best for whatever kind of game you're making so I hope you learned a lot about how to make different camera angles and on real fast
Info
Channel: Cason Quisenberry
Views: 1,947
Rating: undefined out of 5
Keywords:
Id: Wp7xu6TW31Y
Channel Id: undefined
Length: 13min 10sec (790 seconds)
Published: Mon Jul 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.