Lock rotation at angle

Hi there,

i wonder how it is possible to lock a rotation at a specific angle.

My Player is a mech with a gatling on top of his body.
Now I need to stop the rotation when the angle gets bigger than 45 degrees to the left or right.
My second goal is to stop the pitch either before the gatling touches the body of the mech I think this will be at -20 degress.

At the moment the gatling follows the mouse cursor, is there someone out there who can give me a hint how I can stop the rotation and the pitch at 45° / 20° ???

Hello, Harlyk

Try this

Hope it helps!

Hey ,
first of all thx a lot for your help I will try this.
I have to change some functions cause my blueprint work with mouse positions /weapon rotation and not with the camera but i think the result will be the same.

I don´t understand why you set the max pitch to 60 but I think I see what happend later.
Didn´t found set max pitch and set min pitch yesterday so I have to search a bit more as it seems :slight_smile:

Thy a lot again and I let you know if it worked the way it should

Hi again.

i solved my problem with your help thx a lot for this.

I needed to change my function so that it worked with my mouseposition and gatling.

Here is the way it worked for me.