Search Unity

  1. Unity 2018.3 is now released.
    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. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    98
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,932
    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:
    98
    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:
    1,932
    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:
    98
    Ah, sorry!

    But thanks a lot anyway! :)