Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnTriggerEnter(other : Collider)
- {
- StartCoroutine(LerpScale(CurrentScale, NewScale));
- }
- Ienumerator LerpScale(Vector3 CurrentScale, Vector3 NewScale)
- {
- float originalTime = time;
- while (time > 0.0f)
- {
- time -= Time.deltaTime;
- transform.localScale = Vector3.Lerp(CurrentScale, NewScale, time / originalTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement