- Home /
Aircraft smooth return to level flight after banking...
I have an aircraft and, via joystick input, I Roll to the right which indices a yaw/turn to the right. But when I release the joystick, the roll stops as expected) but the aircraft should keep on yawing/turning to the right (relative to the amount of roll). The Roll should also diminish over time and eventually return back to level flight.
Can anybody point me in the right direction (no pun intended) code wise on how to handle this?
Answer by nesis · Feb 03, 2014 at 12:24 AM
Quaternion.Slerp() might achieve a look similar to what you want. It'll take one rotation (eg, current rotation due to roll) and interpolate it to another rotation (eg, current rotation with no roll).
The problem with using Quaternion.Slerp()is with setting the destination rotation as it is constantly changing. That is, the aircraft's Y rotation continues to the right relative to the amount of roll/yaw which are di$$anonymous$$ished over time.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132355im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
AI Aircraft/Spacecraft yaw and pitch help 1 Answer
Change Inertia of rigidbody (Ixy) 1 Answer
Creating my own flight physics? 2 Answers
Center of mass (or center of pull) 2 Answers
2D 360 degress platformer example needed 0 Answers