# How to limit player rotation based on an event?

**URL:** <https://forums.unrealengine.com/t/how-to-limit-player-rotation-based-on-an-event/361807>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, question, Blueprint\
**Created:** [June 23, 2016, 2:50pm UTC](https://forums.unrealengine.com/t/how-to-limit-player-rotation-based-on-an-event/361807 "2016-06-23T14:50:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil-424](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Phil-424](https://forums.unrealengine.com/u/Phil-424)\
**Post date:** [June 23, 2016, 2:50pm UTC](https://forums.unrealengine.com/t/how-to-limit-player-rotation-based-on-an-event/361807/1 "2016-06-23T14:50:03Z")

</div>

How would I go about limiting the players rotation based on an event.

The scenario is this, first person free running game where the player has the ability to grab a ledge. I want to limit the rotation of the players view when grabbing the ledge but i cannot figure out how to do it. I’ve used the set view yaw min and max in the player camera manager but this only works on views that are facing that way, so a ledge where the player is looking at 0 yaw and the min is -40 and the max is +40 this works fine but invert this so the player is doing the same looking at 0 but the other direction the same values don’t apply anymore they are inverse and would need to be like +140 minimum and -140 maximum.

So i guess my question is how would I be able to trace the direction of the player and set the minimum and maximum yaw based on which axis the player is trying to grab the ledge, because i thought it would be trace the normal of the wall and get the rotation from x vector and inverse then break the rotator and -40 and +40 to that rotator and plug that into the value, however this is not the case (I want the view to be limited per ledge aswell, so if the player grabs the wall at a 30 degree angle i dont want them to be able to turn a further 40 degrees away from the ledge). I could set up condition checks and only do the one that is the closest but i want to be able to climb on a curved ledge and the condition setup would mean that it would get funny with values of like a 45 degree wall.

Not sure if I’m explaining this well but if any more clarification is needed i can show pictures, this is the set up for the modified camera controls.
