# How to make my camera follow the player vertically but not horizontally?

**URL:** <https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine\
**Created:** [June 13, 2021, 1:26am UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150 "2021-06-13T01:26:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_041d3229](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_041d3229](https://forums.unrealengine.com/u/anonymous_user_041d3229)\
**Post date:** [June 13, 2021, 1:26am UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150/1 "2021-06-13T01:26:06Z")

</div>

Im really struggling to make this work. I want the camera to follow my player vertically but not horizontally. I have been using the 2d sidescroller template and attempted many different things but i just cant get this to work can anyone help me please ? Also im using blueprint and not C++ if that makes a difference. Any help is highly appreciated !

---

<div class="post-metadata">

**Author:** ![JaredTherriault](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jaredtherriault/32/1194499_2.png) [@JaredTherriault](https://forums.unrealengine.com/u/JaredTherriault)\
**Post date:** [June 13, 2021, 3:43am UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150/2 "2021-06-13T03:43:10Z")

</div>

What have you tried so far?

I’d separate the camera from your player so they’re two separate actors. Then on Tick for the camera actor, get the World Z of your player and set your Camera actor’s World Location to 0,0, PlayerWorldZ.

* * *

[iTween](https://forums.unrealengine.com/t/open-beta-procedural-on-the-fly-animation-in-ue4-itween/10472) : Free, smooth, procedural object animation  
[easyCSV](https://www.unrealengine.com/marketplace/en-US/product/b25b855096e74d088d7553ccbe4072f2) : Read data from any CSV and put them in an easy-to-access string map!  
[Runtime DataTable](https://www.unrealengine.com/marketplace/en-US/product/4c7c4f8d523f4c90b2e26d23502c526c) : Import and export game data to and from CSV or Google Sheets while your game is running!

---

<div class="post-metadata">

**Author:** ![didel23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@didel23](https://forums.unrealengine.com/u/didel23)\
**Post date:** [June 13, 2021, 8:04am UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150/3 "2021-06-13T08:04:11Z")

</div>

you need to find the code that tells the camera to follow the player and either disconnect the X or multiply the transform with a 0 value for X  
i’m not familiar with the 2d template but if i were to make such camera system from scratch i would use a lerp movement instead of a fixed camera.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 13, 2021, 8:53am UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150/4 "2021-06-13T08:53:28Z")

</div>

You could use the Camera Manager to override whatever the camera is doing:

> [@How Do I Set Up the Player Camera Manager?](https://forums.unrealengine.com/t/how-do-i-set-up-the-player-camera-manager/113138/2):
>
> The camera manager is literary both, a brand new camera & its manager. Disabling \*Auto Manage Active Camera Target \*will make the controller ignore any cameras that might be attached to the controlled Pawn and give full control to the Camera Manager (and its own camera). From now on, you need to provide methods for your own camera movement, this is done by returning values from the overridden \*Blueprint Update Camera - \*the Return Value tickbox there is key! In order to pull off a Springarm-li…

Not plug and play, you’d need to provide explicit data for the camera. But it gives you quite a bit a of control over the behaviour.

* * *

> I want the camera to follow my player vertically but not horizontally.

For something a wee bit more ham-fisted yet perfectly serviceable:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/2/d23cc3d740e094a517e77232ceada27075c4e0b1.jpeg)

One note here, if the camera is tied to the level rather than to the player, it might be better to turn the camera into a stand-alone actor to avoid issues further down the line.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_041d3229](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_041d3229](https://forums.unrealengine.com/u/anonymous_user_041d3229)\
**Post date:** [June 13, 2021, 5:06pm UTC](https://forums.unrealengine.com/t/how-to-make-my-camera-follow-the-player-vertically-but-not-horizontally/235150/5 "2021-06-13T17:06:00Z")

</div>

Yesss, this was perfect. Exactly what i was looking for. Thank you so much ! You have no idea how much time i spent trying to get this working !
