I have a value that is being updated inside my Update() function.
I need to pick a value and after some time, compare with the current one.
void Start()
{
prevValue = 0;
InvokeRepeating("checkValue", 0, 0.5f);
}
void checkValue()
{
if (Mathf.Abs(prevValue - currentValue) > 10)
Debug.Log("Ok");
prevAttitude = attitude;
}
I don’t know why, but it’s not working properly. Any other idea about how to make this?
Cheers!