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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Feedback Surprised CallbackContext.duration is always 0 for Button action

Discussion in 'Input System' started by bitinn, Jan 13, 2022.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    Hi,

    Maybe I am missing something here, but I just realized the
    CallbackContext.duration
    value is always 0 for my simple left click button action, because startTime and time are identical.

    That makes these value less useful for my case: I would like to figure out how long a button had been held. There are many other ways (like using Hold interactions), but I thought it is intuitive to extract this info from Input System as it already need to know these values.

    I am getting this value from a PlayerInput with Unity Event, I wonder if I need to use another method?

    Thx