Camera/Spring Arm inverts when I rotate to look straight up or down
I am making a controller for an aircraft and am having issues with the camera/spring arm rotation.
Initially I just set roll to 0 so it would follow the aircrafts rotation, but I wanted to make it so it would instead orient itself to the horizon so if the aircraft is tilted the camera would stay more or less level and not disorient the player. However here is where I ran into a problem.
If I ever just set the relative roll rotation of the spring arm to be set to its present roll rotation from the start of that tick (with or without adding my own modifiers or anything) then when I move the mouse so that I look down and would then have an inverted camera normally looking behind my actor (or if I look up) then when I hit the point that the camera/spring arm goes from being upside down to right side up the problem sometimes occurs.
About one in four times it does what I want it to do like it did when I just set roll to 0, and the camera continues to rotate as it was with no sudden rotations or changes. The rest of the time when I hit this point however my controls and camera suddenly invert, resulting in the camera rotating so as to be upward facing the instant it hits that transition point, at the same time my inputs are now moving it down instead of up and up instead of down (relative to the perceived view).
As an example, working how I want if I start moving my mouse to look down and keep moving it the camera/spring arm will end up looking behind the actor, albiet upside down since it's like having bent your own head down to look between your legs if you will. When it acts like I don't want I start looking down and suddenly upon hitting that look straight down (or up) point my head would snap 180 degrees so that its up is the same as the grounds/worlds up. The problem is this means my continues input to look down is now resulting in upward input as far as I the user am concerned, and this is undesirable.
The part that this issue only happens sometimes is particularly annoying as I can't just put in a manual rotate camera 180 degrees when I reach a given point to correct this manually.
I looked for any auto orient upwards settings on the camera and spring arm but didn't find anything that seemed to help. Also did some searches online but didn't find anything that seemed like my particular issue. In advance thanks for your time reading this and I hope you have a good!
asked Apr 24 '17 at 04:30 AM in Blueprint Scripting
Hey Terricon4 (this might be a bit late, but this is for anyone else having this problem),
The solution is to clamp the
However, in most cases, if the player aggressively moves the mouse, they will be able to still invert it, which is why you want to set it to something like
answered Jun 14 '17 at 12:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here