Search Unity

  1. Unity 2019.1 is now released.
    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:
    101
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,301
    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:
    101
    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:
    2,301
    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:
    101
    Ah, sorry!

    But thanks a lot anyway! :)