What is wrong with my RotateAround?

Hey all!

I wrote this script and i attached to my camera:

void Start()
{
    if (rigidbody)  rigidbody.freezeRotation = true;

    cursorPosition = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
    cursorDiff = new Vector2(0.0f, 0.0f);
}
	
void UpdateCursorDiff()
{
    cursorDiff = cursorPosition - new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
    cursorPosition = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
}

void UpdateLookDirection()
{
    characterHead.transform.RotateAround(new Vector3(0.0f, 1.0f, 0.0f), -(cursorDiff.x * Time.smoothDeltaTime) * cursorSensitivity);
    characterHead.transform.RotateAround(new Vector3(1.0f, 0.0f, 0.0f), (cursorDiff.y * Time.smoothDeltaTime) * cursorSensitivity);
    characterHead.transform.eulerAngles = new Vector3(characterHead.transform.eulerAngles.x, characterHead.transform.eulerAngles.y, -90.0f);
}

void Update()
{
    UpdateCursorDiff();
    UpdateLookDirection();
}

But my character’s head vibrates and when i move my mouse his head turns back to its original state…
Can anyone help me?

(Sorry for my bad english! I am hungarian.)

I’m not sure, but I’m guessing it’s because you use Input.GetAxis(“Mouse X”). Mouse X returns the movement of your mouse’s x since the last frame. So if you don’t move your mouse, it returns 0.

Unless you changed something in the Input inspector of course…