Download

Fixed Camera Pitch?

Hello,

I am having some issues with my current Camera (First Person Camera). I want to restrict the Rotation (Pitch) of the Camera so you can’t see completely straight to the ground, but be able to see completely straight in the air.
The stuff I have tried so far didn’t work out the way I wanted. I tried applying a new “Add Controller Pitch Input” Value when the Camera Pitch is between 90-300. (90 being looking up, doesn’t really go beyong that which is good, and 300 the value I want the camera to stop when looking down)
The Result was basicly that when I looked down and “Forced” my way to look higher than 300 it would “fight” back and in a result look pretty ugly. (I hope you understood what I mean)
Basicly I want just to have a simple Value where I can say You can’t look any further.

Doesn’t anyone know how to do something like that?

Greetings!

Have you tried to clamp it? I’ll upload a screenshot in a moment.

I’m a bit busy right now to actually test it, So let me know if it works out!

Good luck.

Thanks for the Screen. I tried to somewhat recreate it but at least the way I did it didn’t work.

aa24c40de7b3015ba78cd1df254c8bcf12792930.jpeg

Everything works normaly until you get to the -60 points which is in this case looking down to the point I want it to stop. When that Point is hit is switches to the lower lane which clamps the value and Sets the World rotation to the Clamped Value. But after that as you slightly can see it always uses the lower path even if the pitch value I am following is -60 which should result into going to the “Add Controller Pitch Input” which it doesn’t. Even When I set the Clamp at -58 or something but keep the -60 in the compare it still won’t switch up again.

Hmmm, Have you tried it without the compare node / AddController Pitch input? I don’t think it will be needed. Could be wrong but its worth a shot.

Just run the input LookUp straight to SetWorldRotation

Hmm I think in theory you are right and It should work like that. I made it like this:

clamp.jpg

And It SHOULD work like this but it doesn’t. I can look left and right but I can’t look up and down. It is stuck at the 0 start position.
When I mode my mouse up and Down I can see via the Clamped float I am printing and the values I am watching, that It works. It goes up to 90 and down to -60 but it nearly instantly goes back to 0. Its at 90 and goes in like 4 frames back to 0 but I get no visual feedback in anything actually happening, its just like looking up and down is disabled although I can see that values are changing.

Interesting. When I get home I will try out a few things and post them up here with the results.

Alright, Here it is working. Sorry for the mess, Took a bit of tweaking.

Here is the blueprint you will need:

Also you will need to turn the ‘Use Controller View Rotation’ off in the component details panel:

But now our look axis is inverted, so we will need to change that (Unless your one of those heathens who prefers it):

There we go! Let me know how it works out for ya!

In the playercontroller BP you can set the view pitch limits on the camera manager component. Just check “show inherited variables”.

1 Like

Thanks Everyone for the Help!

I treid doing it your way HaxO, but unfortunatly I didn’t get the right results. I could rotate my camera really strange and look Backwards somehow with enough jiggling around :smiley:

Then I tried that was HEGI said but I couldn’t really find the Camer Manager Component, since I didn’t had a Custom player controller. So I had to create a new Custom Player controller and then create a new custom Camera Manager where I then could find under “Player Camera Manager” the Options for View Pitch Min / Max.
Then connect everything to eachother and in the World Settings, and setting MyCharacter rotation back to the standard “Add Controller Pitch Input” and everything works perfectly without a lot of nodes :slight_smile:

Thanks again for the help :slight_smile:

Weird, It was working perfectly for me last night, I did change from world rotation to relative rotation and the ‘-’ to ‘+’.

Glad you found a solution though!

Hi Haxo,
Excuse me but can you explain how do you set the node : Target/Relative rotation, from the “First Person Camera” variable to “Break Rot”?
Many thanks,

Drag your camera into the blueprint graph, drag the output node into space and type ‘rotation’ then select ‘Get Relative Rotation’. Then just drag off the relative rotation and select break rotation from the context sensitive menu.

Is that the info you’re looking for?

If not, could you clarify your question please?

That’s exactly what I was looking for.
It’working fine!
Thank you HaxO,

How can I clamp while using AddRelativeLocation?

Make a variable to reference the location, and instead of using ‘AddRelativeLocation’, add whatever you were adding in the ‘AddRelativeLocation’ to the variable you made, and clamp it while setting the variable, and then set the world location of whatever it is you were moving.

sorry to bump, but I thought I’d chime in with my solution to the problem – I was working off of HaxO’s example and the rolling ball example map. If anyone wanted to figure out how to incorporate yaw, here you go :slight_smile:

Imgur

Hi, did you know how to limit yaw on pawn or character?

I want to limit yaw between 135 to -135, but “view max yaw and view min yaw” only work in “world rotation”, that is not I want.

it would great to get your help, thanks

I used @HaxO way of doing it and worked perfectly. I just used a different way to invert the pitch back. With the Invert rotator, I used it because I wanted to limit the angle for prone only.