Search Unity

  1. Going to #UniteBerlin? Bring a buddy & get 25% off the 2nd ticket! More info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

CineMachine - Base follow offset

Discussion in 'Cinemachine' started by daniel-griffiths, Apr 16, 2018 at 3:41 PM.

  1. daniel-griffiths

    daniel-griffiths

    Joined:
    Jun 14, 2016
    Posts:
    15
    Hello,

    I am trying to change the follow offset of the camera via code based on whether i am in portrait or landscape.

    If anyone knows how to do this would greatly appreciated.
    Please advise.

    Many thanks

    Daniel
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    960
    Assuming that you are using an ordinary Transposer:
    Code (CSharp):
    1. CinemachineVirtualCamera vcam == ...;
    2. var transposer = vcam.GetCinemachineComponent<CinemachineTransposer>();
    3. transposer.m_FollowOffset = bla;
    If you're using a different thing in the Body section, replace "CinemachineTransposer" with the appropriate class.
     
  3. daniel-griffiths

    daniel-griffiths

    Joined:
    Jun 14, 2016
    Posts:
    15
    Perfect!

    Thank you

    Best

    Daniel
     
    Gregoryl likes this.