How can I rotate my flying pawn past 90°?
Im currently in the flying blueprint template messing around in blueprints trying to create a mechanic where upon hitting a key (in this case its Z) the ship will pitched up 180 degrees (a half loop) for you and will make the ship face the other way as a sort of evasive maneuver. However, no matter what I try, it'll only rotate by 90 degrees and no more. I have tried most of the rotation nodes like set actor local rotation but that just causes the ship to go mental. Any ideas?
asked Jun 12 '18 at 02:34 PM in Blueprint Scripting
You want the ship to do a 180 from its current rotation, right?
In your blueprint you're simply setting the pitch to 180 degrees instead of adding 180 degrees to the ship's current pitch.
answered Jun 12 '18 at 03:08 PM
I think you are experiencing Gimbal Lock. This is a weakness in the Euler Rotators used by Unreal and most 3D engines.
I have heard there is a way to overcome it by using Combine Rotators node, supposing that it internally uses Quaternions to calculate the output Rotator. Perhaps that will work (I dont know for sure) to take your current rotation, and then put the added amou t to rotate on the second input of the Combine Rotators node and then do set Actor Rotation from that combine Rotators output.
Let me know if that works.
answered Jun 12 '18 at 03:04 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here