How to look straight up using cinemachine camera?

I have a 3rd person character that uses a cinemachine setup, but I cannot look straight up. Is there a way I can change the settings so that the player can look upwards?
9791010--1405152--upload_2024-4-24_10-15-16.png

9791010--1405158--upload_2024-4-24_10-16-22.png

Yes, set the vertical angle range here:

Note: You should avoid allowing the camera to look straight up or down if you can, because the RotationComposer is subject to gimbal lock in those circumstances. So your vertical range should stop a bit early, say -89 to 89, instead of -90 to 90.

If you absolutely need to really look straight up or down then you will have to use a different CM camera setup, one that is immune to gimbal lock.

Though it shouldn’t happen if the value range is -89.99 to 89.99 … I suppose that’s close enough. :wink:

Thanks for the help, I changed the range to -89 and 89 as you suggested but my character still can’t look that far upwards. This is my current player code, so it may have to do with that. (The video shows that I can look downwards perfectly fine but it doesn’t work when I look up.)
https://www.youtube.com/watch?v=NzK9p25EJbY

using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public CharacterController controller;
    public Transform cam;

    public float speed = 6f;
    public float sprintSpeed = 10f;
    public float turnSmoothTime = 0.1f;
    private float turnSmoothVelocity;

    public float jumpHeight = 3.0f;
    public float gravityValue = -9.81f;

    private Vector3 playerVelocity;
    private bool isGrounded;

    public int maxHealth = 100;
    public int currentHealth;
    public bool isDead = false;

    public float maxStamina = 100f;
    public float currentStamina;
    public float staminaDrainRate = 15f;
    public float staminaRecoveryRate = 10f;
    private bool canSprint = true;

    void Start()
    {
        currentHealth = maxHealth;
        currentStamina = maxStamina;  // Initialize stamina

        // Lock the mouse cursor to the center of the screen and make it invisible
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
    }


    void Update()
    {
        if (isDead) return;

        isGrounded = controller.isGrounded;
        if (isGrounded && playerVelocity.y < 0)
        {
            playerVelocity.y = 0f;
        }

        float horizontal = Input.GetAxisRaw("Horizontal");
        float vertical = Input.GetAxisRaw("Vertical");
        Vector3 direction = new Vector3(horizontal, 0f, vertical).normalized;

        if (direction.magnitude >= 0.1f)
        {
            float targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg + cam.eulerAngles.y;
            float angle = Mathf.SmoothDampAngle(transform.eulerAngles.y, targetAngle, ref turnSmoothVelocity, turnSmoothTime);

            Quaternion targetRotation = Quaternion.Euler(0f, targetAngle, 0f);
            transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * 20);

            float moveSpeed = speed;
            if (Input.GetKey(KeyCode.LeftShift) && canSprint && currentStamina > 0)
            {
                moveSpeed = sprintSpeed;
                currentStamina -= staminaDrainRate * Time.deltaTime;
                if (currentStamina <= 0)
                {
                    canSprint = false;  // Prevent further sprinting when stamina is depleted
                    currentStamina = 0;
                }
            }

            Vector3 moveDir = Quaternion.Euler(0, targetAngle, 0f) * Vector3.forward;
            controller.Move(moveDir.normalized * moveSpeed * Time.deltaTime);
        }

        if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
        {
            playerVelocity.y += Mathf.Sqrt(jumpHeight * -3.0f * gravityValue);
        }

        playerVelocity.y += gravityValue * Time.deltaTime;
        controller.Move(playerVelocity * Time.deltaTime);

        UpdateStamina();
    }

    private void UpdateStamina()
    {
        // Determine if the player is actively trying to sprint
        bool isTryingToSprint = Input.GetKey(KeyCode.LeftShift);

        if (isTryingToSprint && canSprint && currentStamina > 0)
        {
            // Stamina depletes when sprinting is active
            currentStamina -= staminaDrainRate * Time.deltaTime;
            currentStamina = Mathf.Max(currentStamina, 0);

            // Disallow sprinting when stamina depletes completely
            if (currentStamina == 0)
            {
                canSprint = false;
            }
        }
        else if (!isTryingToSprint || (isTryingToSprint && !canSprint))
        {
            // Stamina recovers when not sprinting or attempting to sprint without enough stamina
            if (currentStamina < maxStamina)
            {
                currentStamina += staminaRecoveryRate * Time.deltaTime;
                currentStamina = Mathf.Min(currentStamina, maxStamina);
            }

            // Check if stamina has recovered enough to enable sprinting again
            if (!canSprint && currentStamina >= maxStamina * 0.3)
            {
                canSprint = true;
            }
        }
    }

    public void TakeDamage(int damage)
    {
        currentHealth -= damage;
        if (currentHealth <= 0)
        {
            isDead = true;
            Die();
        }
    }

    void Die()
    {
        Debug.Log("Player has died.");
    }
}

The problem is here:

9794829--1405620--upload_2024-4-25_8-32-51.png

Changing the vertical axis just moves the camera position between the orbits. Your bottom orbit is such that the camera doesn’t need to look up in order to look at the player. Try reducing its radius.

If you’re making a third-person-shooter style camera, FreeLook isn’t the best way to go. Have a look at this tutorial: