Character Controller is Choppy

Hi, I am using the following code as a first person character controller:

using UnityEngine;
using System.Collections;

public class CharacterController : MonoBehaviour {

    public float mouseSpeedX;
    public float mouseSpeedY;
    public float playerMoveSpeed;
    public float jumpForce;

    float verticalLookRotation;
    Rigidbody rb;
    Ray ray;

    bool isGrouded() {
        Vector3 pos = transform.position; pos.y -= 0.98f;
        Collider[] cols = Physics.OverlapSphere(pos, 0.2f);
        if (cols.Length > 1) return true;
        else return false;
    }

    void Start() {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
        rb = GetComponent<Rigidbody>();
    }

    void Update() {

        if (Input.GetKeyDown(KeyCode.Escape)) {
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible = true;
        }
        if (Input.GetMouseButtonDown(0)) {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible = false;
        }

        Camera.main.transform.localPosition = new Vector3(0f, 0.75f, 0f);
        transform.Rotate(Vector3.up * Input.GetAxis("Mouse X") * Time.deltaTime * mouseSpeedX);
        verticalLookRotation += Input.GetAxis("Mouse Y") * Time.deltaTime * mouseSpeedY;
        verticalLookRotation = Mathf.Clamp(verticalLookRotation, -90, 75);
        Camera.main.transform.localEulerAngles = Vector3.left * verticalLookRotation;

        rb.velocity = new Vector3(0f, rb.velocity.y, 0f);
        float finalMoveSpeed = (Input.GetKey(KeyCode.LeftShift)) ? playerMoveSpeed * 1.5f : playerMoveSpeed;

        Vector3 movement = transform.TransformDirection(new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")).normalized);
       
        rb.MovePosition(transform.position + movement * finalMoveSpeed);
       
        if (Input.GetKey(KeyCode.Space) && isGrouded()) rb.velocity = new Vector3(rb.velocity.x, jumpForce, rb.velocity.z);
    }
}

Moving the player is relatively smooth, and so is looking around. I noticed, however, that when I am moving and rotating, like, orbiting around a cube while looking at it, the camera gets very choppy. Does anyone have a similar problem, or possible solution? Thanks.

Use LateUpdate to update the camera. This way before the screen renders the camera it’s updated to the most recent position.

I am still bored so I took the liberty to clean up your code and (possibly) fix your issue.
(Im no pro with player controllers so it may not be perfect just a little bit of updating needed)
As @lordofduct said above, use LateUpdate for the camera.
If im doing something wrong let me know, feedback is good.

using UnityEngine;
using System.Collections;
public class CharacterController : MonoBehaviour {
    public float mouseSpeedX;
    public float mouseSpeedY;
    public float playerMoveSpeed;
    public float jumpForce;
    float verticalLookRotation;
    Rigidbody rb;
    Ray ray;
    bool isGrouded() {
        Vector3 pos = transform.position; pos.y -= 0.98f;
        Collider[] cols = Physics.OverlapSphere(pos, 0.2f);

        if (cols.Length > 1)
            return true;
        else
            return false;
    }
    void Start() {
        LockCursor();
        rb = GetComponent<Rigidbody>();
    }

    void LockCursor()
    {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
    }

    void UnlockCursor()
    {
        Cursor.lockState = CursorLockMode.None;
        Cursor.visible = true;
    }
    void Update() {
        if (Input.GetKeyDown(KeyCode.Escape))
            UnlockCursor();
        if (Input.GetMouseButtonDown(0))
            LockCursor();
        UpdatePlayer();
     
        if (Input.GetKey(KeyCode.Space) && isGrouded())
            rb.velocity = new Vector3(rb.velocity.x, jumpForce, rb.velocity.z);
    }

    void UpdatePlayer()
    {
        transform.Rotate(Vector3.up * Input.GetAxis("Mouse X") * Time.deltaTime * mouseSpeedX);
        verticalLookRotation += Input.GetAxis("Mouse Y") * Time.deltaTime * mouseSpeedY;
        verticalLookRotation = Mathf.Clamp(verticalLookRotation, -90, 75);
        rb.velocity = new Vector3(0f, rb.velocity.y, 0f);
        float finalMoveSpeed = (Input.GetKey(KeyCode.LeftShift)) ? playerMoveSpeed * 1.5f : playerMoveSpeed;
        Vector3 movement = transform.TransformDirection(new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")).normalized);
     
        rb.MovePosition(transform.position + movement * finalMoveSpeed);

    }

    void LateUpdate()
    {
        UpdateCamera();
    }

    void UpdateCamera()
    {
        Camera.main.transform.localPosition = new Vector3(0f, 0.75f, 0f);
        Camera.main.transform.localEulerAngles = Vector3.left * verticalLookRotation;
    }
}

Notice how I split the code into methods (functions) this makes for neater and more reusable code. It is good practice to do this.

EDIT:
The forums keeps screwing my code and deleting some empty lines to split up code, why is that?

Thanks, it does look alot neater! But, sadly, it probably won’t fix the original issue…I put my Camera controlling code in lateUpdate already, thinking that the camera would render everything after the player moved, and it would fix it…Sadly, it didn’t fix the issue. I’m wondering at this point if it’s one of Unity’s classic unsolvable issues, like fast objects teleporting through things, etc.