[RC3] POV cam, where is it? and how to set its axis values in script?

I see that there isn’t a POV camera to choose from in the Cinemachine menu, so I’ve created a standard vCam and selected POV for the Aim.

However, now I’d like to use a custom input solution – not Unity’s Input Manager – as I do for my freeLook cams. How do I access the input axis values of a vCam with a POV aim in script? I don’t see access to it – maybe I’m unsure where to look or approaching this incorrectly?

You’ve made the POV camera the right way.
You can access the POV public members like this:

using Cinemahine;
CinemachineVirtualCamera vcam;
CinemachinePOV pov = vcam.GetCinemachineComponent<CinemachinePOV>();
pov.m_HorizontalAxis.Value = bla;

There is also pov.m_VerticalAxis. What the axis does, in its update method, is this: m_InputAxisValue = CinemachineCore.GetInputAxis(m_InputAxisName);

In CinemachineCore, you’ll find this:

        /// <summary>Delegate for overriding Unity's default input system.  Returns the value
        /// of the named axis.</summary>
        public delegate float AxisInputDelegate(string axisName);

        /// <summary>Delegate for overriding Unity's default input system.
        /// If you set this, then your delegate will be called instead of
        /// System.Input.GetAxis(axisName) whenever in-game user input is needed.</summary>
        public static AxisInputDelegate GetInputAxis = UnityEngine.Input.GetAxis;

So the default is to use Unity’s input system, but you can stick your own delegate in there to drive the axis value.

2 Likes

Hi, i’m faceing the same problem. I’m trying to reset/force my axis to the values you see in the screenshot.
I’m getting errors even following your code above. maybe i’m missing something…


When is the vcam member set?
Your code will fail because vcam is null.

1 Like

Fixed it. thanks