How to get a rigidbody's Local Angular Velocity (Yaw, Pitch & Roll) ?

I had some trouble finding how to get a rigidbody’s local angular velocity (with respect to its own Axes instead of the World’s), which can be useful for Flight / Space simulator games, so i thought I would post the way I overcame that problem.

Hope it saves you some trouble :slight_smile:

The solution to this problem came by slightly modifying an answer I came across, posted by user RavenBlack:

Vector3 localAngularVelocity = target.transform.InverseTransformDirection(target.rigidbody.angularVelocity);

localAngularVelocity.x is the target’s Pitch,

localAngularVelocity.y is the target’s Yaw,

localAngularVelocity.z is the target’s Roll,

assuming the target’s forward is aligned with its z axis.