Problem multiplying quaternions

    void FixedUpdate()
    {
        Quaternion x = Quaternion.AngleAxis(xRot, transform.right);
        xRot = xRot + -Input.GetAxis("Vertical") * speed * Time.deltaTime;
        xRot = Mathf.Repeat(xRot, 360);

        Quaternion y = Quaternion.AngleAxis(yRot, transform.up);
        yRot = yRot + Input.GetAxis("Horizontal")  * speed * Time.deltaTime;
        yRot = Mathf.Repeat(yRot, 360);

        transform.rotation = x * y;

    }

Doing following code, the object will spin out of control… if I only use 1 axis, it will go as normal

what I should do ?

I don’t know why that’s spinning out of control, but what you should probably do is use the much simpler code of transform.rotation = Quaternion.Euler(xRot, yRot, 0); (after updating xRot and yRot).