Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it 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. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    92
  2. Gregoryl

    Gregoryl

    Unity Technologies

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

    But thanks a lot anyway! :)