Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Setting the Heading bias via script

Discussion in 'Cinemachine' started by MSachs, Oct 31, 2018.

  1. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    122
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Code (CSharp):
    1. var transposer = vcam.GetCinemachineComponent<CinemachineOrbitalTransposer>();
    2. transposer.m_Heading.m_Bias = bla;
     
    MSachs likes this.
  3. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    122
    Do I need anything else? For me it doesn't recognize the GetCinemachineComponent<...>();

    With this error message:

    Error CS1061: 'CinemachineFreeLook' does not contain a definition for 'GetCinemachineComponent' and no extension method 'GetCinemachineComponent' accepting a first argument of type 'CinemachineFreeLook' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Assembly-CSharp)

    Edit: It seems to be different with a freeLook cam I guess?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    ah, you didn't mention that it was a FreeLook. In that case it's even simpler:
    Code (CSharp):
    1. freeLook.m_Heading.m_Bias = bla;
     
  5. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    122
    Ah, sorry!

    But thanks a lot anyway! :)