Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function OnTriggerEnter(other : Collider)
  2. {
  3. StartCoroutine(LerpScale(CurrentScale, NewScale));
  4. }
  5.  
  6.  
  7. Ienumerator LerpScale(Vector3 CurrentScale, Vector3 NewScale)
  8. {
  9. float originalTime = time;
  10.  
  11. while (time > 0.0f)
  12. {
  13. time -= Time.deltaTime;
  14. transform.localScale = Vector3.Lerp(CurrentScale, NewScale, time / originalTime);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement