# Camera clamp is always based on the world coordinate X.

**URL:** <https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800>\
**Category:** Programming & Scripting\
**Tags:** pitch, unreal-engine, clamp, Blueprint, question, yaw\
**Created:** [March 21, 2024, 10:25pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800 "2024-03-21T22:25:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikelKram](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikelkram/32/1011745_2.png) [@MikelKram](https://forums.unrealengine.com/u/MikelKram)\
**Post date:** [March 21, 2024, 10:25pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/1 "2024-03-21T22:25:02Z")

</div>

Сamera Rotation Clamp Works, BUT… after the movement stops, the camera randomly selects an angle for the clamp.

Clamp ON:

 ![clampON](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/c/e2c648d7449b707b2dd44dae43d7d9e64a42b10d.png)

Clamp RESET:

 ![clampRESET](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/4/7e4ec104e6f862775d481b4cd7f8542b3e2734a6.png)

Video showing that it works correctly at the **beginning** , but **then** randomly selects angles + also rotates the camera.

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [March 22, 2024, 12:08am UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/2 "2024-03-22T00:08:49Z")

</div>

Hey @MikelKram!

I’ve got a way you can test this a little more extensively:  
The “Append” node. Check it out:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/4/4a46861e0cdd7b57c7c6cf142fe047a5a8ef663e.png)  
This way you can actively see what’s happening. Gotta understand the problem before you can find the solution! 🙂

Let us know what the results turn out to be!

---

<div class="post-metadata">

**Author:** ![MikelKram](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikelkram/32/1011745_2.png) [@MikelKram](https://forums.unrealengine.com/u/MikelKram)\
**Post date:** [March 22, 2024, 10:40am UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/4 "2024-03-22T10:40:12Z")

</div>

The values I set for ‘Pitch Max/Min’ and ‘Yaw Max/Min’ are working correctly. I confirmed this using the ‘Append’ node. The problem is that this **camera angle clamp ignores the direction the player’s camera** is facing **and randomly selects the angle clamp** , sometimes taking the right vector instead.

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [March 22, 2024, 3:38pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/5 "2024-03-22T15:38:40Z")

</div>

Hm. Maybe try “Get Player Forward” off of the player controller, then split that as it will be a vector, then add/subtract your 80/-80 to get the max/min values. I don’t know if camera manager is based off of local rotation off the top of my head. But it seems based on experience I’d normally have to get player forward if I’m basing anything off of player rotation.

Give that a go and let us know!

---

<div class="post-metadata">

**Author:** ![MikelKram](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikelkram/32/1011745_2.png) [@MikelKram](https://forums.unrealengine.com/u/MikelKram)\
**Post date:** [March 22, 2024, 10:37pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/8 "2024-03-22T22:37:45Z")

</div>

Well, here’s the solution to the problem:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/3/f532aaad3e10e831884ab58d8950088ea4e94cc3.png)

---

<div class="post-metadata">

**Author:** ![MarKage\_14](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MarKage\_14](https://forums.unrealengine.com/u/MarKage_14)\
**Post date:** [October 16, 2024, 7:55pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/9 "2024-10-16T19:55:59Z")

</div>

**Thank you so much!** The best answer and maybe the only one for this specific case! 🤩

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 15, 2024, 7:56pm UTC](https://forums.unrealengine.com/t/camera-clamp-is-always-based-on-the-world-coordinate-x/1765800/10 "2024-11-15T19:56:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
