Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Getting the camera direction vector

Discussion in 'Cinemachine' started by Mangonels, Sep 1, 2020.

  1. Mangonels

    Mangonels

    Joined:
    May 8, 2018
    Posts:
    20
    How can I get the vec3 direction from a CinemachineVirtualCamera?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Do you mean camera forward?
    vcam.State.CorrectedOrientation * Vecor3.forward
     
    Mangonels likes this.
  3. Mangonels

    Mangonels

    Joined:
    May 8, 2018
    Posts:
    20
    Yes thank you. This seems to be the same as what I call "DirectionVector" (Used to calling it like that when doing math in OpenGL)