'is there a way to rotate an actor's pitch past 90 degrees in unreal engine 4
I a working on a game and for some reason I can't get my component to rotate past 90 degrees pitch. I've distilled it down to EventTick->AddRelativeRotation(0, 5, 0) but when it hits the 90 degrees pitch mark it simply jitters back and fourth. I've read many pages on this topic and I simply cannot find an answer. If anyone can help it would be greatly appreciated.
Solution 1:[1]
This is known bug since 2014 but is not fixed yet. One way to get around this is make a rotator before then assign this rotator to target object.
- Break old rotation into 3 float values
- Make a new rotator adding the offset value from the old rotation (y=5 in your case)
- Assign rotation to desired object
Solution 2:[2]
Rotations using only three axes can be problematic. Rotations are more stable and reliable when using quaternions. The jittering you mention sounds a lot like something that would be fixed by using quaternion rotation instead.
It can be a bit confusing but there's plenty of documentation about this on the internet now that you have a term to search for.
Then, have a look at this UE forum post: Rotate a mesh around its center using quaternion It contains a link to a video showing how to do rotations using quaternions in UE, and some Blueprint that might help as well.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | From Far East |
Solution 2 | Robot Head |