Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

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!

Product Version: UE 4.15
more ▼

asked Apr 24 '17 at 04:30 AM in Blueprint Scripting

avatar image

11 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Terricon4 (this might be a bit late, but this is for anyone else having this problem),

The solution is to clamp the Pitch of the Spring Arm constantly between values of -90 or above, and 90 or below, like so: pic

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 75, so that there is a lot of dead zone where the player can't push past. Hopefully there will be an option to disable Spring Arm inversion soon.

more ▼

answered Jun 14 '17 at 12:05 PM

avatar image

46 1 6 8

avatar image Terricon4 Jun 14 '17 at 11:41 PM

I tried it out but fortunately it did not eliminate the issue of the random inversion of the spring arm, since it's tied to the roll, it can still flip around. And it still did it only some of the time, without a clearly identifiable cause for it's inconsistent behavior....

While your method can work for helping to lock the camera in during simply looking around, the problem was that I was using it with an auto orient to keep spring arm facing upwards so the X axis would be adjusted so even as the actor bobs around when bumped the camera was level with the world. The problem was that when flipped upside down the spring arm would not simply end upside down (I was ok with that), but rather that it would (at random about one in four times) invert the spring arm and thus controls relative to the cameras orientation (the camera would maintain the wanted orientation though thanks to the auto stabilization adjusting the roll, it would just end up resulting int he inputs being the problem).

So while I thank you for the answer and time, and for some people searching with similar tags do to at heir own problems it may help,for the specific issues I was (and still am) having it is unfortunately not a fix.

avatar image Alaanor Jun 16 '17 at 03:04 PM

Ah, I believe constantly clamping the roll could possibly work.

avatar image Terricon4 Jun 16 '17 at 05:00 PM

Unfortunately clamping the roll to -180 through 180, -179 through 179, or any such number does not stop the core issue of it randomly inverting control input some of the time, while also leading to some unwanted side effects should it be less than the -180 to 180 area.

I've had it on my list to make a visual showing current mouse inputs on the screen so I can record some footage of it to clearly show the problem and make a bug report but I've been putting it off do to other things I've been working on.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question