public static IEnumerator SufficientHandMovement(float threshold, float seconds) { float t = 0; while (ValidHands(threshold) && t < seconds) { t += 1; yield return(new WaitForSeconds(1)); if (t > seconds) { break; } } if (t >= seconds) { if (SnowMoundBehavior.canSpawnSnowball) { SnowballBehavior b = Instantiate(vrHands.SnowballPrefab).GetComponent <SnowballBehavior>(); b.SetOVRGrabberFollow(GetOVRGrabber(true)); Debug.Log("Sufficient Hand Movement, spawn snowball"); } else { Snowfall.ActiveSnowball().ScaleUp(LeftHandPositionDerivative + RightHandPositionDerivative); Debug.Log("Add to snowball" + (LeftHandPositionDerivative + RightHandPositionDerivative)); } } else { yield return(vrHands.StartCoroutine(SufficientHandMovement(threshold, seconds))); } }