Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question InputSystem.QueueStateEvent(): how to use the time parameter?

Discussion in 'Input System' started by ltomov, Sep 15, 2023.

  1. ltomov

    ltomov

    Joined:
    Aug 3, 2017
    Posts:
    96
    As per the docs, this function takes 3 parameters:
    Code (CSharp):
    1. public static void QueueStateEvent<TState>(InputDevice device, TState state, double time = -1)
    But it seems like whatever value I put in the time parameter, it's ignored. I tried putting seconds, millis, seconds + Time.time - the event is still executed immediately. How is this parameter supposed to be used? And I'm not sure I understand its purpose fully.

    What I'm trying to do is to call InputSystem.QueueStateEvent() several times, making sure the events are executed with a small delay from each other (say 50ms).

    Am I doing it wrong?

    Thanks!
     
  2. ltomov

    ltomov

    Joined:
    Aug 3, 2017
    Posts:
    96
    Got it - the update mode needs to be "fixed update" in order for this parameter to work that way.