This is driving me crazy!
I’m designing a UI to track the user’s hand speed. I need to get the maximum speed to be displayed on my interface. I’ve tried many methods but the script below is the closest I can get. This reading I’ve got is constantly changing and I just can’t get the max value to stay there. Any help?!
void Update ()
{
//left hand
initialL = LHand.transform.position;
LHspeed = (initialL - currentL).magnitude / Time.deltaTime;
currentL = initialL;
MaxSpdL = 0;
if(LHspeed>MaxSpdL)
{
MaxSpdL = LHspeed;
}
}