# Make camera move if player is on the edge of the screen

**URL:** <https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691>\
**Category:** Blueprint\
**Tags:** screen-position, unreal-engine, UE4, Blueprint, question\
**Created:** [January 18, 2020, 2:12am UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691 "2020-01-18T02:12:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoganDolan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LoganDolan](https://forums.unrealengine.com/u/LoganDolan)\
**Post date:** [January 18, 2020, 2:12am UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691/1 "2020-01-18T02:12:14Z")

</div>

I want to make the camera move with the player if the player is moving to the edge of the screen, moving with him to always keep the player on the screen.

In the setup that I have, I have implemented a target lock system that sets the position of the root of the spring arm between the targeted AI and the player, so as we an see both the player and the AI. The issue is when you move the camera and the player character, you can have the camera look at the targeted AI while the player character is off screen.

I want it so that the camera always keeps the player on the screen, even if you move the camera and the player separately. A good example of this mechanic can be seen in Legend of Zelda: Breath of the Wild. The camera would either zoom out or move with Link as he approaches the edge of the screen (while in target lock mode) but the camera can still be moved by the player.

I hope that I’ve explained what I meant well, if not then I can edit the post and maybe provide diagrams to illustrate my issue.

---

<div class="post-metadata">

**Author:** ![brianheagney](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brianheagney/32/706476_2.png) [@brianheagney](https://forums.unrealengine.com/u/brianheagney)\
**Post date:** [February 4, 2024, 4:10pm UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691/2 "2024-02-04T16:10:54Z")

</div>

Did you ever figure this out? I’m hoping to work on this soon too 🙂

---

<div class="post-metadata">

**Author:** ![SyrRokZu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyrRokZu](https://forums.unrealengine.com/u/SyrRokZu)\
**Post date:** [February 4, 2024, 4:25pm UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691/3 "2024-02-04T16:25:13Z")

</div>

This seems fitting, unsure if youtube links are good practice but it definetly is what youre looking for. [https://www.youtube.com/watch?v=sesU3SPpn7o](https://www.youtube.com/watch?v=sesU3SPpn7o)

---

<div class="post-metadata">

**Author:** ![brianheagney](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brianheagney/32/706476_2.png) [@brianheagney](https://forums.unrealengine.com/u/brianheagney)\
**Post date:** [February 11, 2024, 5:24pm UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691/5 "2024-02-11T17:24:14Z")

</div>

Hi, I had a student who was hoping to figure this out, and I THINK this video can lead to something that would work:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/b/13b005e01e07c7947de798525b7dfe0cf41a2927.jpeg "WTF Is? Project World to Screen in Unreal Engine 4 ( UE4 )") ](https://www.youtube.com/watch?v=pA3K0oWUEj8)

I adapted the concept to a third-person template, and made a VERY BORING video showing what I did. Note, this is not a fun tutorial, it’s just me working my way through adapting the concept from the video above to make it work for my needs:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/7/b175b31632851c62c7549708be5ec56f2d18cab0.jpeg "CamThingForDaniel") ](https://www.youtube.com/watch?v=oQpc1zTWqNk)

Hope this helps someone, I really haven’t seen anyone post anything that can do what we’re wanting.

---

<div class="post-metadata">

**Author:** ![VonRage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VonRage](https://forums.unrealengine.com/u/VonRage)\
**Post date:** [February 5, 2025, 11:16am UTC](https://forums.unrealengine.com/t/make-camera-move-if-player-is-on-the-edge-of-the-screen/460691/6 "2025-02-05T11:16:35Z")

</div>

Maybe I’m misunderstanding but wouldn’t just using a clamp while setting the camera relative position on tick work? You’d probably have to turn it on and off somehow but any boolean or 2 that only happens in this scenario should work.
