Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Input System 1.1.1 always return 0 with readValue<float>() in player

Discussion in '2021.2 Beta' started by hugofreiregil, Oct 24, 2021.

  1. hugofreiregil

    hugofreiregil

    Joined:
    May 31, 2019
    Posts:
    7
    Hi,

    when try to read a value from an Axis control type

    upload_2021-10-24_20-1-28.png
    upload_2021-10-24_20-1-53.png

    Code (CSharp):
    1. playerInput.actions["Move"].ReadValue<float>()
    always returns 0, but it works perfectly in build. Same problem with Vector2 values. With Buttons works correctly.
    If I downgrade to 1.0.2 it works perfectly in player and in build.

    Thanks
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  3. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    222
  4. Jhey_Murasaki

    Jhey_Murasaki

    Joined:
    Mar 31, 2018
    Posts:
    1
    this still happens in 1.3.0?? with me if you use more than 2 actions the second will always return ZERO
     
  5. unity_nick_

    unity_nick_

    Joined:
    Sep 24, 2021
    Posts:
    5
    I filed a bug report about this (some inputs receiving a value of zero when read a second time). Unity marked it as a duplicate of the following issue (linked), so I voted on that issue to be fixed. You should too if it's causing you problems (in my case I'm postponing upgrading to newer versions of Unity and the Input System) else who knows if Unity will ever consider it important enough to be fixed.


    https://issuetracker.unity3d.com/is...ot-received-when-using-input-system-1-dot-4-1
     
  6. Atto2O

    Atto2O

    Joined:
    Aug 19, 2018
    Posts:
    6
    I fixed it by just updating the package InputSystem to 1.4.4.

    Hope it helps!