CinemachineInputAxisController.OrbitScale + InputSystem not work

Hello. I use CinemachineInputAxisController and new InputSystem for input to cinemachine orbital camera.
and Look X / Y work fine.

I use default CinemachineDefaultInputActions

but zoom (mouse scroll delta) not work. only if i use legacy input

I suppose that mouse scroll delta is Vector, and report value to Y axis

if I write custom processor SwapAxisProcessor and add it to scroll delta, then zoom will work

SwapAxisProcessor Code
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;

namespace GameJam.Plugins
{
    [Serializable]
    public class SwapAxisProcessor : InputProcessor<Vector2>
    {
        [Tooltip("send x-axis to y-axis and vise versa")]
        public bool swapAxis = true;

        public override Vector2 Process(Vector2 value, InputControl control)
        {
            return swapAxis ? new(value.y, value.x) : value;
        }

$if UNITY_EDITOR
        [InitializeOnLoadMethod]
#endif
        [RuntimeInitializeOnLoadMethod]
        public static void Init()
        {
            Debug.Log("Initializing SwapAxisProcessor");
            InputSystem.RegisterProcessor<SwapAxisProcessor>();
        }
    }
}

Yes, it’s a bug in the default bindings - it’s reading the scroll X value instead of the scroll Y. Your solution is a good one.

1 Like