The issue that is a problem has to do with the fact that I am rotating the wheel by using an aim constraint, and it resets the localEulerAngles after reaching 360, so my resulting value can only is only 0-360, as opposed to an actual angle that is cumulative.
I have made an attempt at taking the current value and subtracting the prev value before the current value changed, but I haven’t got that to work just yet.
Euler angles can jump all over the place as an object rotates and are not a good way to solve this issue. Instead find the delta rotation each frame and grab the angle from that.
Quaternion prevRot;
float finalNum = 0;
void Start()
{
prevRot = myWheelMain.transform.localRotation;
}
void Update()
{
//This returns the quaternion rotation between this frame and the last frame
Quaternion fromPrevToCurrent = Quaternion.Inverse(prevRot) * myWheelMain.transform.localRotation;
finalNum += fromPrevToCurrent.eulerAngles.y;
prevRot = myWheelMain.transform.localRotation;
}