To avoid gimbal lock, I use quaternions for my rotations. For example, to roll I use this function:
FQuat rollRot(float multiplier)
{
return FQuat::FindBetweenVectors(mesh->GetUpVector(), mesh->GetRightVector() * multiplier + mesh->GetUpVector() );
}
It works fine as long as I don't need the current "roll" value.
I cannot just take the x Euler angle of my rotations. For example, in these cases I would expect roll value of 10, but it is 90 and 180: