Overriding the limited camera rotation

Hi everyone, I’m trying to implement a blueprint that restricts the player characters rotation when they’re on a ladder. I have a blueprint solution that has taken inspiration from other forum posts and videos and in theory it does exactly what I want. BUT… the problem is that by pushing the mouse either left or right at maximum speed and distance you can force the character to rotate even when using the recommended blueprint.

I’m not sure what is happening here, but my guess is that the action value X of IA_Look reaches such a high value that it somehow overrides the View Yaw Max. Or maybe it has something to do with mouse-sensitivity?

No video+comments or forum post discusses this bug, which made me think that my custom Player Character might be coded in a weird way. But nope! The same issue arises when I’m using the UE5.6 First Person New Project template.

I’m using a newly created First Person project and in the BP_FirstPersonCharacter I’ve set up the following blueprint:

When pressing the 2-key the players camera rotation is limited. But by pushing the mouse as fast and far as it is possible on a desk, the limitation seems to be overridden.

Why is this?

Hey @Hannez555! Welcome to the forums!

Have you tried using a “Clamp (float)” Node? You have an input, a min, and a max value, then the output will be within those values no matter what. That should keep you from being able to go past your maxes there, as those numbers aren’t even possible to hit.

Give that a try and let us know how it goes!! :slight_smile:

I’ve tried using the clamp as you’ve suggested and while it was an improvement in other ways it didn’t fix the problem. I also noticed how the Get World Rotation has the format from -180 to +180 whereas the view yaw min/max goes from 0-360 which may be the source of the problem. To fix this I tried to combine the clamps with make rotators as per this discussion Rotation negative after 180 degrees and again it improved the precision of the desired view restriction but ultimately it didn’t fix the main problem either.

My blueprint looks like this now:

You can add 180 to every rotation value so your values are always in range 0-360 if that helps. Solves a lot of problems with having to account for negative values.