1
\$\begingroup\$

I have no idea how to get the FreeLook cam to work with the second stick on a gamepad. The docs seem to have nothing on the topic. Has anyone done this before ?

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

Turns out it's rather easy. You just need to delete the Axis names from the FreeLook component and create a small script like this :

using Cinemachine;
using UnityEngine;
[RequireComponent(typeof(CinemachineFreeLook))]
public class FreeLookUserInput : MonoBehaviour {

    private CinemachineFreeLook freeLookCam;
    // Use this for initialization
    void Start () {
        freeLookCam = GetComponent<CinemachineFreeLook>();

    }

    // Update is called once per frame
    void Update () {
        freeLookCam.m_XAxis.Value = Input.GetAxis("Right Stick X");
        freeLookCam.m_YAxis.Value = Input.GetAxis("Right Stick Y");

    }
}
\$\endgroup\$
0
\$\begingroup\$

This actually inputs a value for the Cinemachine Freelook controller to work with, directly changing the value as mentioned above has no dampening etc

using Cinemachine;
using UnityEngine;
[RequireComponent(typeof(CinemachineFreeLook))]
public class FreeLookUserInput : MonoBehaviour {

private CinemachineFreeLook freeLookCam;
// Use this for initialization
void Start () {
    freeLookCam = GetComponent<CinemachineFreeLook>();

}

// Update is called once per frame
void Update () {
    freeLookCam.m_XAxis.m_InputAxisValue = Input.GetAxis("Right Stick X");
    freeLookCam.m_YAxis.m_InputAxisValue = Input.GetAxis("Right Stick Y");

}

}

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .