Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LateUpdate()
- {
- float mouseX = Input.GetAxis("Mouse X") * mouseSense * Time.deltaTime;
- float mouseY = Input.GetAxis("Mouse Y") * mouseSense * Time.deltaTime;
- xRotation -= mouseY;
- xRotation = Mathf.Clamp(xRotation, pitchMinMax.x, pitchMinMax.y);
- playerBody.Rotate(Vector3.up * mouseX);
- //transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f); // Rotates only from camera perspective, I want it to rotate around playerBody
- transform.RotateAround(playerBody.position, new Vector3(mouseY, 0f, 0f), mouseSense * Time.deltaTime); // This is the best shot I've had
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement