Search Unity

1 Frame Lag With All Control Input. Rage.

Discussion in 'Scripting' started by TacticalDan, Jul 6, 2013.

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    That blog post is 4 months old, so I wouldn't be so pessimistic.
     
  3. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I guess. However, I don't like the structure they announced. The idea of adding a component on everything that handles input is odd. Why have this duplication of roles?
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    there are links on that blog to the latest test version and the feedback forums. Now is the time to politely earbash the devs about stuff not when it comes out :) :p
     
    chelnok, TaleOf4Gamers and KelsoMRK like this.
  5. losingisfun

    losingisfun

    Joined:
    May 26, 2016
    Posts:
    36
    I dont think this issue has been solved. I have a rather annoying problem where I need to check if the same button has been pushed in a different script, but in order to check, I need to use a 4 frame delay in an IEnumerator, because of the delay. if I use a 3 frame delay, it only has a 50/50 chance of working (script orders, I suppose, not sure why).

    If I wanted to create a FPS, I would definitely avoid Unity, no question.
     
  6. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    I have no idea what you're talking about- the issue as described here IIRC doesn't cause a 3-4 frame delay, it causes a delay of precisely 1 frame, and only sometimes. If you have a problem with your input, you should make a thread about it and provide some code and a full description of the problem so that people can try to help you with the issue.

    The only way I can imagine that large of a delay with input is if it's being mishandled somewhere outside of Unity, or you're checking a script that's previously checked a script that's previously checked a script that's previously checked a script for the input poll result, and every single one of those scripts is executing in exactly the wrong order. That's not a Unity problem, it's a programming problem.

    If you need better input, use Rewired or something. Unity is still 100% fine for FPS games.
     
    Last edited: Jan 26, 2018
  7. losingisfun

    losingisfun

    Joined:
    May 26, 2016
    Posts:
    36
    I'm using rewired, and I'm definitely getting a 3 frame delay, even with very basic tests.
     
  8. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Please elaborate. Rewired does not have a 3-frame or even 1-frame lag. It processes input values at the beginning of the frame and keeps that value the same throughout the duration of the frame.

    If you are seeing a 3-frame lag, you may be getting input in FixedUpdate but do not have Rewired set to update in FixedUpdate, so the value is not updated until the beginning of the next Update frame which may or may not be updated for each FixedUpdate depending on how fast your current frame rate is and what the physics time step is set to.

    Another possibility is the device you are using is lagging at the hardware level and the operating system is unable get fresh data from it as quickly as expected.
     
    Last edited: Feb 16, 2018
  9. losingisfun

    losingisfun

    Joined:
    May 26, 2016
    Posts:
    36
    oops,

    yeah, that input was in FixedUpdate, poor oversight on my part. (and solved an annoying problem on my end)