I am working on a game mechanic for a wheel that when turned, gives the value of the localEulerAngles and stores into the variable currentNum
currentNum = myWheelMain.transform.localEulerAngles.y;
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.
Here’s how I’ve approached that…
currentNum = myWheelMain.transform.localEulerAngles.y;
difNum = (currentNum - prevNum);
if (difNum != 0.0f)
{
prevNum = currentNum;
difNum = 0.0f;
}
finalNum += difNum;