Input System - Mouse scroll input suddenly stopped working

Green highlight: works just fine
Red highlight: doesn’t work

My mouse input stopped working, it doesn’t change the Y value of “Look” (Vector2) anymore.

I worked on it a few days ago and everything still worked then but now it just refuses to move.
Any ideas how to fix?

I’ve tried changing to both delta and scroll but nothing. As soon as I press the numpad 8 button, it does work. My mouse also is fine so I don’t understand what’s going on.

Weird thing is that it did work before, exactly the same system.

The ECS Input System goes like:

using UnityEngine;
using Unity.Entities;

public partial class InputSystem : SystemBase
{
    private InputSystemControls input = null;
    protected override void OnCreate()
    {
        input = new InputSystemControls();
        input.Enable();
    }
    protected override void OnUpdate()
    {
        foreach (
            RefRW<InputData> data

            in SystemAPI.Query<
                RefRW<InputData>
                >())
        {
            data.ValueRW.move = input.Player.Move.ReadValue<Vector2>();
            data.ValueRW.lookDirection = input.Player.Look.ReadValue<Vector2>();
        }
    }

    protected override void OnDestroy()
    {
        base.OnDestroy();  
        input.Disable();
    }
}

InputData:

using Unity.Entities;
using Unity.Mathematics;

public struct InputData : IComponentData
{
    public float2 move;
    public float2 lookDirection;
    public bool isInteracting;
    public float zoom;
}

n

To anyone else having a similiar issue, if you’re using custom input setting make sure to enable the supported input devices.

1 Like