Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. 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.

  1. daniel-griffiths

    daniel-griffiths

    Joined:
    Jun 14, 2016
    Posts:
    21
    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:
    1,549
    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:
    21
    Perfect!

    Thank you

    Best

    Daniel
     
    Gregoryl likes this.