Search Unity

Virtual Camera Rotation Information

Discussion in 'Cinemachine' started by m506, Feb 14, 2018.

  1. m506

    m506

    Joined:
    Dec 21, 2015
    Posts:
    93
    Hi there,

    I am using a freelook camera and I am trying to get the current rotation of the virtual camera so I can update some player states. What I tried to query so far:
    FL_Camera.transform.rotation
    FL_Camera.transform.localEulerAngles
    FL_Camera.transform.eulerAngles
    FL_Camera.LookAt.transform.rotation
    FL_Camera.m_Heading
    FL_Camera.VirtualCameraGameObject.transform.rotation
    FL_Camera.localRotation


    They all return static values as I rotate around the x and y axis, without any relevant current rotation information.

    Can someone please help me?

    Thank you in advance!
    Marco
     
  2. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    What about using main camera's rotation, Will it work for you?
     
    Last edited: Feb 14, 2018
    Gregoryl likes this.
  3. m506

    m506

    Joined:
    Dec 21, 2015
    Posts:
    93
    Yes, that was it. Thanks for the quick response!
     
    JakubSmaga likes this.