Advertisement
Eonirr

Untitled

May 10th, 2023 (edited)
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. IEnumerator CoroutineLerp()
  2. {
  3. timer = 0;
  4.  
  5. var baseValue = _valueVariable1;
  6. var targetValue = _valueVariable2;
  7.  
  8. while (timer < _timeToChangeValue)
  9. {
  10. _valueToChange = Mathf.Lerp(baseValue, targetValue, timer / _timeToChangeValue);
  11.  
  12. timer += Time.deltaTime;
  13. yield return null;
  14. }
  15.  
  16. _valueToChange = targetValue;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement