SHARE
TWEET

Untitled

a guest Feb 15th, 2020 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void LateUpdate()
  2.     {
  3.         float mouseX = Input.GetAxis("Mouse X") * mouseSense * Time.deltaTime;
  4.         float mouseY = Input.GetAxis("Mouse Y") * mouseSense * Time.deltaTime;
  5.  
  6.         xRotation -= mouseY;
  7.         xRotation = Mathf.Clamp(xRotation, pitchMinMax.x, pitchMinMax.y);
  8.  
  9.         playerBody.Rotate(Vector3.up * mouseX);
  10.  
  11.         //transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f); // Rotates only from camera perspective, I want it to rotate       around playerBody
  12.         transform.RotateAround(playerBody.position, new Vector3(mouseY, 0f, 0f), mouseSense * Time.deltaTime); // This is the best shot I've had
  13.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top