Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. var speed:int;
  3. function Update () {
  4.  
  5. moveDirection = new Vector3((Input.GetAxis("Mouse X")), (-Input.GetAxis("Mouse Y")), 0);
  6. // moveDirection = transform.TransformDirection(moveDirection);
  7. // moveDirection *= speed;
  8. if (moveDirection.sqrMagnitude > 0) {
  9.     transform.LookAt(transform.position + moveDirection);
  10. }
  11. }