public void LateUpdate()
    {
        // rotate camera(vertical) and model(horizontal)
        float xRot = Input.GetAxis("Mouse Y") * Time.deltaTime * xSensitivity; // get rotate input
        float yRot = Input.GetAxis("Mouse X") * Time.deltaTime * ySensitivity; // get rotate input

        if (shouldRotate)
        {
            playerRotation.Rotate(new Vector2(xRot, yRot));
            // rotate model(horizontal)
            //transform.Rotate(0f, yRotInput, 0f, Space.World);
            // rotate camera (vertical)
            // have to clamp rotation around xAxis (vertical look)
            //RotateXAxisClampedBidirectionally(-xRotInput, maxVerticalLookAngle);
        }
    }
Пример #2
0
 private void FixedUpdate()
 {
     playerMovement.Move();
     playerRotation.Rotate();
 }