Search Unity

Bug [New Input System] Initial state for Mouse Position is 0 ?

Discussion in 'Input System' started by msh91, Apr 11, 2021.

  1. msh91

    msh91

    Joined:
    Apr 22, 2017
    Posts:
    37
    I'm using the new input system, and I have a component that inside Update is reading the mouse Position (using generated C# class):

    `InputControls.Game.MousePos.ReadValue<Vector2>()`.

    InputControls is the name of the variable (type is the generated input class)
    Game is the action map
    MousePos is the action.

    According to this:
    https://docs.unity3d.com/Packages/c...anual/ActionBindings.html#initial-state-check

    When action type is set to Value, the initial value should be set correctly.
    However when starting the game the value is always zero until the mouse is moved.

    Anyone knows any workaround for this?