Пример #1
0
    void LateUpdate()
    {
        yaw   += playerController.input.LookDirection.x * settings.sensitivity;
        pitch -= playerController.input.LookDirection.y * settings.sensitivity;
        pitch  = Mathf.Clamp(pitch, settings.pitchMinMax.x, settings.pitchMinMax.y);

        settings.AdjustDistance(playerController.input.ZoomLevel);

        currentRotation       = Vector3.SmoothDamp(currentRotation, new Vector3(pitch, yaw), ref rotationSmoothVelocity, settings.rotationSmoothTime);
        transform.eulerAngles = currentRotation;

        transform.position = target.position - transform.forward * settings.distance;
    }