Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator CoroutineLerp()
- {
- timer = 0;
- var baseValue = _valueVariable1;
- var targetValue = _valueVariable2;
- while (timer < _timeToChangeValue)
- {
- _valueToChange = Mathf.Lerp(baseValue, targetValue, timer / _timeToChangeValue);
- timer += Time.deltaTime;
- yield return null;
- }
- _valueToChange = targetValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement