Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    105
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,952
    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:
    105
    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:
    3,952
    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:
    105
    Ah, sorry!

    But thanks a lot anyway! :)
     
unityunity