Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Callbacks invoked twice in Android build?

Discussion in 'Input System' started by Kazko, Sep 14, 2020.

  1. Kazko


    Apr 2, 2014
    I have setup a very simple action for pointer press, which works in editor, PC build and Android build. However, the behavior is inconsistent. In Editor and PC Build, the started, performed and canceled phases work as expected.

    Mouse Down: Started > Performed
    Mouse Up: Canceled

    In Android build, the performed callback is called twice:

    Touch Down: Started > Performed > Performed
    Touch Release: Canceled

    This seems to happen during a callback when the actual action takes place. For example, if I add Interaction for Press - Release only, the expected behavior in Editor/PC is:

    Mouse Down: Started
    Mouse Up: Performed > Canceled

    But in Android build:

    Touch Down: Started > Started
    Touch Release: Performed > Canceled

    Additional info: When inspecting the frames at which the callbacks take place, duplicated callbacks happen within 1 frame difference. Occasionally there is 2-5 frame difference, and sometimes they happen on the same frame.

    Is this a bug or am I missing something? Thanks for any info!