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