Download

Camera Setup

Hello guys i’m trying to recreate a little flight racing game where you’ll only move the ship to the left or right, but I’m a little stuck with the camera system since I’m just starting unreal, I’d say that I do know C++ to a medium level but i’m just starting this game development journey to learn about it, I’ll give you some example of what I want to achieve in this next pic

sketch camera boosted.jpg

Where those players who fall out of the camera range dies and respawn, I think I do know how to achieve that but i’m stuck on how to make the camera be independent of the player movement and move around by itself throughout the little race track I’ve done following the track of the players, is this achieved with an AI? I’m just asking for some tips/advices since this is just for learning purposes, thanks in advance I’ll highly appreciate any help! Sorry if I made a mistake posting this around here, and for any grammar related issue, english is not my 1st language!

Bumps----!

Shouldn’t be too hard to do. If the zoom of the camera moves in and out, then I would project the lower-most pixel to World-Space, then create a world-space ‘axis’ which essentially runs along the bottom of the screen (which you can easily create with your world-position information and the cameras right vector).

Get the normalized direction vector from that projected world position and the craft position, then you can work out if it’s behind the axis or not (and therefore off-screen)

Mind you, an easier way would be to just add a collision primitive as a child of the camera, that lines up with it’s view frustrum. If the vehicle hits it, they’ve fallen behind and are dead :slight_smile:

Woo thanks man! i’ll try to work this out : D i was stuck on how to make the camera move around the little track without being attached to a player i’ll try to work it out as you suggested thank you very much!!

You can inherit from APlayerCameraManager and in that class override UpdateViewTargetInternal where you simply do something like:
OutVT.POV.Location = NewLocation;
OutVT.POV.Rotation = NewRotation;

Then in your player controller set your PlayerCameraManagerClass to be your new camera manager class. This gives you complete control over the camera.