How can I limit pitch rotation through Blueprints?

First I want to thank anyone who reads this for there time and help.

I am attempting to make a game that involving flying ships(Sky pirates). I started by copying the Blueprints from the flying demo and attempting to work forward. Right now I’m having an issue limiting the amount of pitch the ship can rotate.
So far I have tried using clamp float and clamp angle to limit the amount. Depending on where I plug them in I get one of three options;

A) Pitch rotation speed is reduced.

B) Pitch is limited to within the parameters, but yaw is locked out.

C) Pitch is limited but the player pawn snaps back to default rotation.

I think I have found an answer but it is for C++ and I’m not so clear on the programming theories behind some of the blueprints ( art guy). Limiting Pitch Rotation

If there is anything else you all would need or if I should post this somewhere else, let me know and I will do what I can.

For a bonus if anyone would be amazingly awesome and help me to understand the theories behind what I have now ( the basic flying Blueprint) I will be in your debt and will make you dinner one day.

Again thank you for the time.

Hi BlueTheTall,

I use this script in a entirely unrelated project for someone. I used it to limit the pitch and yaw control rotation of the spaceship every tick. Should work well in this situation. Good luck!

Peace

1 Like

Wow thank you for helping so quickly. I have three more questions

  1. I cannot find “Set Controller Rotation” Instead I used “Set Actor Rotation”,( which may be the cause for my third issue.)

  2. “Get Player Controller will not plug into “Get Control Rotation.” Both " Get Player Character” and “Get Player Pawn” do work but I run into the same issue with all of the combinations have tried.

  3. I’m not sure where to plug this in at, it seems everywhere I try with the different combination of the above problems result in the boat sitting at an odd angle when spawned and not responsive to directional input.

Again thank you for the response, I will continue to play around in the off chance I can figure it out and if I do, I will post it here.

Sorry for the delayed response. Work is brutal! - You must pull from a Player Controller in order to get functions that affect the Player Controller. If you can’t find it that way, take context sensitive off temporarily to find it.

No worries my friend, all help is appreciated. One more question/issue.

I have completely copied the code from the flight, and manage to copy the code you gave me, but no matter where I plug them in at it doesn’t seem to work. I posted below all the relevant code I have, maybe there is something I missed.

alt text.

Hey these are very useful infos! thanks for sharing!

I’m working on a 2.5D scroller and trying to implement this BP above…basically I need to be able to rotate the camera around, WITHOUT affecting the position of the pawn (which should move only left-right-back-forward but without changing the frontal pov). So far I got this:

and have the feeling the 2 things highlighted in red should be replaced with something related to camera? anyone have an idea about how to do this? cheers

I actually figured this out, simply starting from the 2.5D scroller template and ticking use pawn control rotation!

Hi I know this is very old but I would like to understand the math behind why you subtract 180 and add 180 once more after the clamp?

i dont remember anymore XD but I guess it was to invert the axis of the fov? i think it might be redundant