# Static Camera on Endless Runner

I am developing a mobile game in ue4. For this project, I need to have a "static" camera so that the player can move within the frame not affecting camera location and rotation. But as this is an endless scroller I also need to have the camera move at a constant pace limiting the player's area of movement. Does anyone know how to do this?

• Am I correct to assume you currently have a camera that is follows the player? It's generally a good idea to provide your current situation as clearly as possible. If I understand correctly: you have a camera that follows the player, but you want to have it pointed in a static direction while giving it a fixed speed. Is that correct? If so, please edit your question to reflect that. If not, please edit your question to reflect what you've tried and where you're stuck. – Peethor Apr 14 '19 at 10:14
• What specific part of this are you stuck on at the moment? The forward movement of the camera? The bounding of the player's movement? The movement of the bounds with the camera? – DMGregory Apr 14 '19 at 12:39
• Basically everything because I can't break the link between the camera and the player. – Sigma 17 Apr 14 '19 at 17:37
• Basically the camera is within the character blueprint and as a patent it will obviously follow the character and I don't want that. – Sigma 17 Apr 14 '19 at 17:39

I could think of two ways on how to solve your problem.

• Player-centered approach: Update the position of the static camera based on the position of the player pawn

e.g. in pseudocode assuming the player moves into the x direction:

Vector3 cam_to_player_distance = {0, 100.0f, 100.0f};
cam_position = player_pawn.getActorLocation() + cam_to_player_distance;


• Camera-centered approach: (my choice)

Make the camera the controlled pawn and add the runner as a child actor. Now you can freely move the runner to the left and right and without the camera being affected

Greatings, the trick is not moving the player but the level.

• That is a trick. You could simply give the camera a fixed (or even variable) speed. – Peethor Apr 14 '19 at 10:10
• One line answers are generally incomplete. How would they achieve this? – Vaillancourt Apr 14 '19 at 11:45
• Also, yes, it's a "trick", but the general consensus is still to move the camera. – Vaillancourt Apr 14 '19 at 12:13
• It absolutely needs to be moving to my project – Sigma 17 Apr 14 '19 at 13:54
• Peethor the problem is how to do this since the camer need's to be parented to the character and it can't be the character's root – Sigma 17 Apr 14 '19 at 14:00