- Home /
Yaw, Pitch, Roll adjustments relative to object?
I am a newbie stil learning / exploring Unity.
In a 3d flying game I want the player to be able to control yaw, pitch, and roll of their craft.
This means that RELATIVE TO THE PLAYER CRAFT yaw changes the horiziontal direction of craft, Pitch changes the virtcle angle, roll is rolling around the forward axis.
To do yaw pictch roll means that once the orientation of the craft is off of 0,0,0 then a change in yaw or pitch or roll will be relative to the craft but in real world coordinates/orientation a change to yaw will be a change in multiple real world orientation axises.
Does Unity support this directly somehow?
Answer by zannghast · Sep 30, 2010 at 05:29 AM
I'm not sure if you've gotten your answer already. But seeing that no one has yet to post an answer, here's mine (albeit a simple one).
What you're describing in your third phrase seems to be the Euler angles of an object:
- yaw would be the euler rotation y around the y axis of the object
- pitch would be the euler rotation x around the x axis of the object
- roll would be the euler rotation z around the z axis of the object
Here's a link to the online reference regarding an object's Transform component where you may find direct references to controlling an object's (rather, an object's Transform) rotation and euler angles : Transform component