MaximilianPs

Unity - Fake Rotation It's a Move

Jan 15th, 2012 (edited)
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. Vector3 rut = new Vector3(0, 0, 20);
  2. Vector3 targetPos = Vector3.zero;
  3.          
  4. Vector3 pos = targetPos;
  5.        
  6. pos.x += (float)(25f * Mathf.Cos(angles.x) * Mathf.Sin(angles.y));
  7. pos.y -= (float)(25f * Mathf.Sin(angles.x));
  8. pos.z += (float)(25f * Mathf.Cos(angles.x) * Mathf.Cos(angles.y));
  9.  
  10. _sun.transform.position = new Vector3(pos.x, pos.y, pos.z);
Add Comment
Please, Sign In to add comment