Search Unity

Read out where camera currently looks at

Discussion in 'Cinemachine' started by Doomchecker, Sep 4, 2021.

  1. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi,
    is it possible to read out the rotation from the Free Look Camera, meaning where it currently looks at in an UpdateLoop?

    Thanks for helping out!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    If the vcam is controlling the main Camera, then you can just use the main camera's transform. Otherwise, you can use freeLook.State.CorrectedPosition and freeLook.State.CorrectedOrientation.

    Make sure to do this late in the frame, after the CM Brain's LateUpdate, or you will get stale values from the previous frame.
     
    Doomchecker likes this.