Search Unity

Joystick lag

Discussion in 'Editor & General Support' started by centaurianmudpig, Dec 16, 2011.

  1. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    92
    Hello,

    I am having some trouble with my joystick. The input can be around (what feels like) half to a full second delay between pressing a button or moving the axis stick to displaying the intended output on the display. This happens in the Unity Editor and "build and release" for either PC or Webplayer. Interestingly there is no lag when using the keyboard for the same actions.

    I am using a Saitek Cyborg F.L.Y. 5 joystick. It works fine in the profiler and in other games I use it for without any lag. My Unity project runs consistently 60FPS. I had noticed the joystick lag when I first started using Unity and I can be certain there is nothing I have coded which is contributing to the lag.

    I had a go searching and haven't found anyone else with this issue. Hopefully it will be something simple and you kind folks will be able to help me fix this.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Go to the input manager and change the setup for the appropriate axes, specifically gravity/sensitivity.

    --Eric
     
  3. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    92
    I had these set from the start, the variables for the axis are:

    Gravity: 0
    Sensitivity: 1
    Dead: 0.16
    Set to use Joystick 1.

    For buttons Gravity and Sensitivity are set to 1000.

    I should have also mentioned the lag is inconsistent. This is most noticable on moving the joystick axis and applies to the buttons too.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    In that case I don't know; I've never encountered any input lag.

    --Eric
     
  5. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    92
    A little investigating shows that it may be specific to some of the Saitek joysticks with Unity. Some user's of the Kerbal Space Program, which uses the Unity engine, are having the same problem as me. Updating to the latest driver's for the joystick did not help me.

    When I tried using a 360 pad and there was no input lag.

    [Edit]
    I have been having a look around and came across Input.ResetInputAxes(). While it removes the lag associated with the joystick axis it's not something I can use as it also affects the button presses.
     
    Last edited: Dec 17, 2011
  6. Batman187

    Batman187

    Joined:
    May 25, 2009
    Posts:
    11
    I am running into this same problem with my Saitek F.L.Y 5 joysticks. I have two identical joysticks of this type and I have confirmed that the problem is present with both of them. However, when I use a different Saitek joystick (Saitek x52 Pro or Saitek ST290 Pro) there is no lag whatsoever.

    I have tested the Saitek F.L.Y. 5 joysticks in two different scenes and although I get slightly different results, the lag problem is always there:

    - When I try the joysticks in a nearly empty test scene with fps over 60, it starts off with no lag, but then after using it for a while I notice the lag increase up to about 1/2 to 1 second of lag.

    - When I try the joysticks in a larger scene with fps at around 30, the lag gets really bad immediately. Up to about 2 full seconds of lag on all axes and buttons. I tested using the other Saitek joysticks in this scene and there was zero lag.

    onegoodman, have you found a solution yet? This lag problem makes this otherwise great joystick unusable. I really hope I can find a solution or work-around because otherwise, I will have to return them and get a different kind of joystick.
     
    Last edited: Feb 15, 2012
  7. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    92
    I don't think there is a solution on our end as Unity is handling the input and the Joystick works fine in non-Unity games and in the windows control panel. Since the beta version, the lag was slightly reduced. Will have to hope the Unity dev's will fix it.
     
  8. tamberlain

    tamberlain

    Joined:
    Jun 16, 2013
    Posts:
    20
    This problem still exists years later. Saitek joysticks using latest drivers lag with ALL Unity games. If you remove the official Saitek drivers and use Windows default driver then the input lag vanishes. I have not experienced any lag using my Saitek X52 Pro joystick setup and any other games. Just ones made with Unity (including my own). This is a serious problem for anyone making flight sims or space sims with Unity as Saitek joysticks are widely used by the kinds of people likely to buy and play such games.
     
  9. Elaskanator

    Elaskanator

    Joined:
    May 26, 2016
    Posts:
    1
    This problem still exists years later... My Saitek X55 is not working with Kerbal Space Program even after setting the sensitivity to less than 1% and the lag is also atrocious.

    Edit I just uninstalled the Saitek drivers (and deleted them... the one nice new feature of Windows 10) and that fixed it (but don't remove the throttle drivers). So it is the Saitek drivers causing an issue with Unity, so long after the first report that a human could have been born and grown up enough to play the game more competently with a keyboard.

    Steps taken:
    1. Use Saitek drivers on Windows 10 x64, probably same version from upgraded Windows 7 (x64) - one axis would always be oversensitive (tried X and Z only), invariant of sensitivity setting in game
    2. Uninstall (and delete) the Stick drivers only - works properly
      (See the attachment)
    3. Uninstall the Throttle drivers - throttle stops working
    4. Download latest drivers (Windows 10 x64) - original issue returned
    5. Uninstall the first Stick driver (the one without a parenthetical qualifier) - issue remains
    6. Uninstall the Stick (Bulk) driver - issue remains
    7. Uninstall the final driver: Stick (HID) - issue fixed
    Note that I didn't run Action > Scan for hardware changes after steps 5 or 6, but had to after 7.
    Interestingly (read: infuriatingly), the second time I uninstalled drivers I had to go to the in-game settings (without restart) where I put the sensitivity back from near zero to 100%. Then it worked fine after that (at least for my first flight so far... I might edit this again later).
     

    Attached Files:

    Last edited: May 26, 2016