duck

duck

Aug 2nd, 2010
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var degrees : float;
  2. var offset : Vector2 = Vector2(0.5, 0.5);
  3.  
  4. function Update() {
  5.     degrees = Input.mousePosition.x;
  6.     rotation = Quaternion.Euler(Vector3(0,0,degrees));
  7.     trans = Matrix4x4.TRS(-offset, Quaternion.identity, Vector3.one);
  8.     rot = Matrix4x4.TRS(Vector3.zero, rotation, Vector3.one);
  9.     inv = Matrix4x4.TRS(offset, Quaternion.identity, Vector3.one);
  10.     renderer.materials[1].SetMatrix("_Rotation", inv*rot*trans);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment