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

[Solved] Accessing Cinemachine via code

Discussion in 'Cinemachine' started by Seith, Sep 11, 2018.

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    703
    Hi, I got a simple question: how can I (at runtime via code) change the Axis names that CM is listening to? Please feel free to be as detailed as possible. :)
     
    Last edited: Sep 11, 2018
  2. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    703
    Ok, got it! All I need to do is:
    Code (CSharp):
    1. using Cinemachine;
    2. ...
    3. myGameObjectWithFreeLook.GetComponent<CinemachineFreeLook>().m_XAxis.m_InputAxisName = myName;
    (I think I'm going to open a separate thread for the potential bug)
     
    Gregoryl likes this.
  3. EID

    EID

    Joined:
    Dec 4, 2012
    Posts:
    3
    Only works for installs from the AssetStore. This is not working in 2.2.7 installed from the Package Manager with Unity 2018.2.6f1 on Windows 10.
     
    Last edited: Sep 13, 2018
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,731
    What do you mean, it doesn't work? What happens when you try it?