How Setup Clamp Camera Rotation?

Hi everyone, I’ve been trying for days how to limit the pitch for the player camera by using the clamp/float node but have not figure it out for the life of me. I have watch plenty of videos and read many answers on her but there’s two things I can’t figure out. One thing is how and which BP do I use to create a PlayerCameraManager BP and how do I get the variables listed in the detail panel. I would like to use the mouse and the gamepad thumbstick to be able to rotate the camera pitch but with limits. Right now I still have it without limit and I have an example attached. I really appreciate the help in advance everyone. Also, just to mention I have a camera boom attached to the camera if anybody’s wondering.

287050-without-limit-pitch.png

This is a tricky one … The input values here are incrementally added [-1 to 1] over time. So it’s not working like “hey, the stick is up 45 degrees, so look down exactly 45 degrees”. It’s more like “wherever you are right now, keeping looking down MORE until I say stop”. So what I would suggest is feeding the “Add Controller Pitch Input” node a “Select Float” where the green Axis Value goes into A, and B is set to zero - the output pin goes into Val. Then on the red pin (for Select A) you’d want to test to see if the Axis Value is positive AND the camera pitch has not yet exceeded your threshold in one direction (OR vice versa, axis is negative AND you haven’t gone too far the other way). This will allow the input to be passed thru across the range of angles you want, but will start feeding zeros as input the instant you have gone too far which will prevent pitching beyond your range. Hope that makes sense.

Hey 1|2 Hawk, thanks for your answer, I appreciate it. I think I got it, I’m going to try it out as you said and see how it goes. Thanks again.

Hey again 1|2, is there anyway you can provide a sample bp for reference? I tried but could not get it at all. Thanks again.

get camera get world rotation break rotation struct pin by right clicking the output on the get world rotation, take the rot if greater or equal to “Not Bool” whatever your desired rotation to clamp, then feed it into a “select Float” if select float is not greater than the desired rot then it will “Pick A” if it is it will not “Pick A”. feed result to the add pitch or wherever. Hope this helps. GAMEBR0VIP#2462 on Discord.