I am making an aircraft game and I need to the get the change in Yaw of the aircraft.
I am attempting to save the previous frame's transform.eulerAngles
and push them back to local space of the transform so I can capture the change. I am trying transform.InverseTransformXXXXX
but it doesn't seem to work.
private float _GetChangeInYawAngle()
{
float yaw = transform.InverseTransformDirection(m_lastForwardParented).y;
yaw = yaw > 180 ? yaw - 360 : yaw;
m_lastForward = transform.parent.eulerAngles;
return yaw;
}