Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

[Solved] Accessing Cinemachine via code

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

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    710
    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:
    710
    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. PeterWilkinson

    PeterWilkinson

    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:
    2,300
    What do you mean, it doesn't work? What happens when you try it?