Hey all,

Imagine a ship in space - it rolls to the right, then yaws left. It SHOULD roll in the direction it originally rolled (‘right’), forever, regardless of how it yaws. At the moment, the constant roll value is being applied to it in a local sense, i.e. it will roll to the ‘right’ of the ship’s nose (clock-wise), no matter which way you point the ship after the fact.

When rolling, for example, this is the simple code, where m_rollPercentage is used to make the angular acceleration increase gradually, and 10000 is an arbitrary place-holder for the power of the ship’s thrusters;

```
void RollRight()
{
m_rollPercentage += 0.10f;
m_torque.z += m_rollPercentage * 10000;
}
```

And this is the code to update the rotation for the object:

```
void UpdateRotation()
{
Quaternion convertedRotation = Quaternion.AngleAxis(m_angularVelocity.x * Time.deltaTime, transform.right);
m_additionalRotation = convertedRotation * m_additionalRotation;
convertedRotation = Quaternion.AngleAxis(m_angularVelocity.y * Time.deltaTime, transform.forward);
m_additionalRotation = convertedRotation * m_additionalRotation;
convertedRotation = Quaternion.AngleAxis(m_angularVelocity.z * Time.deltaTime, transform.up);
m_additionalRotation = convertedRotation * m_additionalRotation;
m_additionalRotation = convertedRotation * m_additionalRotation;
m_rotationAngle += m_angularVelocity * Time.deltaTime;
m_angularAcceleration = m_torque / m_momentOfIntertia;
m_angularVelocity += m_angularAcceleration * Time.deltaTime;
m_additionalRotation = NormalizeQuaternion(m_additionalRotation);
gameObject.transform.rotation = m_additionalRotation;
m_torque = Vector3.zero;
}
```

I’ve been trying to solve this issue for a while, so any advice would be great!

- HateDread