Advertisement
NPSF3000

LerpTransform

May 20th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. //untested
  2.  
  3. public static class Helper
  4. {
  5.     public static void LerpTransform (this Transform t1, Transform t2, float t)
  6.     {
  7.         t1.position =   Vector3.Lerp(t1.position, t2.position, t);
  8.         t1.rotation =   Quaternion.Lerp (t1.rotation, t2.rotation, t);
  9.         t1.localScale =   Vector3.Lerp(t1.localScale, t2.localScale , t);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement