How To Stop Camera Clipping In Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to another Unreal Engine 4 and 5 tutorial so in today's video what we've been going over is how to stop camera clipping in third person so if I were to hit play I'll show you what's going to happen so sometimes you might get it where if you are near a wall and you rotate your camera like this it's going to go inside the wall like so and we obviously don't want that as that looks pretty terrible what we want is instead it's just going to kind of bounce off the wall and just stay on this side so that does happen by default when you start a new third person template map however sometimes a lot of people will they mess about with their character or they create a new character from scratch and they change it about which then means the camera is broken it's bugged and you get something like this again many reasons why that might happen for you but today I'm going to be going over a way to fix it no matter what reason it's broken this will solve the problem for you so let me delete this code and I'll show you how we're going to fix this so what we're going to do is we're going to open up our third person character blueprint so for me there's gonna be content browser so control space third person blueprints BP third person character now if we go to the viewport you might have something set up like this so you've got the mesh and you've got the camera on the mesh or you might have a camera room or a spring arm but again if it's broken I'm going to show you how to fix it so what we want to do is with just third person characters self-selected we're going to add and we're going to add the component of a spring arm like so now if you already have the camera room you can use that or you can delete it and start again like this the camera boom is the spring arm if they've just renamed it so we're going to get that and then we're going to do is drag the camera onto the spring arm so it's parented like so so we have spring arm and then follow camera here like this what we're going to do is with the follow camera selected we're just going to set location and rotation just back to zero zero zero by default so it's going to be at the end of the spring arm then if we select spring on here what we can do is we can move where the camera is going to be so what you might have done is you might have then just wanted the camera in a different location so you moved it like this that's not going to work because if we select the spring arm you'll notice the end of it isn't lining up with the camera so this here is going to be the Collision for our camera so that's where we want our camera to be which is why we're making sure it stays there like so if you want to move the camera what you're going to want to do is move the target offset like so and this will actually then move the camera so if I set this to 100 on the X you'll notice it's going to move like this or 100 on the Z and so on and so forth but with the rotation you can just change the rotation of the camera itself that will work perfectly so I want the target arm length to be a bit longer so I'll set it to 400 and you'll notice that's now moved out perfectly like so one more thing we want to do on the spring arm is make sure we take use Pawn control rotation so the camera is actually going to move how we want using the player's controls one final thing I'm going to do is I'm going to select third person character self and search for your and make sure that use control the rotation your is unticked so it's false we can compile save all of that close it now if we hit play this should be working perfectly so we can move the camera as we normally would and if you were to go up to this wall move the camera it's not going to go in the wall it's going to collide with it and stay on this side moving alongside the wall as you can see perfectly there and again this will work for any surface even the floor the walls whatever it's not going to clip through it's going to nicely collide with it and stay working like this so I think that'll be it for this video is we've done everything we want to do what we've done is we've just set up a simple camera Collision so that it's not going to clip through walls it's going to collide with the walls of the floor any surface we want so it's going to stay on this side and look nice and perfect for us so thanks so much for watching this video I hope you enjoyed it and I hope you found it helpful and if you did please make sure to like subscribe down below so thanks so much for watching and I'll see in the next one [Music]
Info
Channel: Matt Aspland
Views: 25,974
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, blender, unity, games design, ue5, unreal engine 5, unreal engine 5 tutorial, ue5 tutorial, stop, prevent, clip, clipping, through, walls, wall, floor, how to stop, camera, tpp, third person, going, ue5 camera clipping, ue5 stop camera clipping through wall, stop camera, prevent camera, objects, roof, ceiling, it, cliping, cliped, clipped, camera boom, boom, spring arm, length, move
Id: sesU3SPpn7o
Channel Id: undefined
Length: 3min 58sec (238 seconds)
Published: Sun Jan 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.