Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. void LateUpdate(){ // Script in main camera
  2.     offset = Quaternion.AngleAxis(Input.GetAxis("Mouse X") * mouseSense * Time.deltaTime, Vector3.up) *
  3.                   Quaternion.AngleAxis(Input.GetAxis("Mouse Y") * mouseSense * Time.deltaTime, Vector3.left) * offset;
  4.     offset.y = Mathf.Clamp(offset.y, pitchMinMax.x, pitchMinMax.y); // This is my attempt
  5.     transform.position = playerBody.position + offset;
  6.     transform.LookAt(playerBody.position);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement