Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

.ReadValue<float>() is HIGHLY inaccurate resulting in terrible control.

Discussion in 'Input System' started by Unlimited_Energy, Jan 7, 2022.

  1. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    There is a major issue with releasing the controls or moving them any faster than slow, they are not updated correctly and the value of the controller coming back if the joystick on the gamepad is move too fast in a direction or too fast back is NOT returning the correct value. im checking every frame what the value is and if the stick is at 0 on any controller and the position changes too quickly it gets stuck on values that are waaay off, resulting in highly inaccurate controls.

    if i push the control stick all the way to the left and releases it, it could be stuck on a value of 0.75, almost full left, on every gamepad I try. If I move slow it works. why if your calling .ReadValue<float>(), would it be returning a value different than 0 or atleast close too it? its like its permanently holding different values untill you change the joystick position again. so where exactly does .ReadValue<float>() read from, if its not reading from the current joystick position? its keeping a reference somewhere, it has too be, and its not updated untill the joystick moves again, no matter how many times you call .ReadValue<float>(), it will return the same freaking value.

    podracer.PNG
     
  2. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Have you tried reading Vector2 rather than float?
     
    Unlimited_Energy likes this.
  3. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    I will try it out