I’m new to UE4 and I’ve been working on a top-down game. The camera pawn is already setup, but I decided that I’d like the camera to follow the terrain and move up and down slopes. Currently the basic top-down setup with boundary collision causes the pawn to collide with sloped/ raised surfaces and float over the landscape when it’s lower than the pawn.
Is there something I’m missing in UE4 that makes this possible with ease?
Or am I going to have to config the controller setup like you would with a playable character to have it recognize terrain changes.
First off, thanks for the suggestion. I’ve used lice tracing to find distance in FPS games but didn’t dawn on me to use the same method for this. I have run into a problem, I’ve created the line trace and as it stand it just reads the distance. I’ve tried a few different ways to use that info to control the z axis position of my camera pawn with no luck. I feel like I need a second person to check my work lol, as I’ve missed the simple solution a few times with this project.
Not at the moment. I have the movement bound to WSAD for X&Y axis, and am not looking to give the camera a keybind for the Z axis. I’ve looked all over for other approaches to having the camera float above the ground and move up and down slopes while maintaining the same height above ground and am surprised that I’ve found only 3 other conversations about this, none having a solid answer for RTS & Top down style games. Most floating camera questions pertain to 3rd person and FPS games.
Wow i was missing a few things, like using a Flnterp, the delta time and the required height nodes. I went straight off the world location xy to the set vector location and came off the vector distance straight to the z location. This worked thanks for your help.
Now I just have to figure out why when the camera sphere is on a slope and I rotate the camera with its back against the slope the sphere then falls through the ground and gets stuck below the terrain.
Update, its not the rotation, its the pan up/down. When I pan the camera to be more of a level angle with the ground and move it backwards to a slope the sphere falls through the ground. I caught the sphere moving up and down on the Z axis over a flat surface when I pan the camera down closer to the ground.