Search Unity

[Android] Hiccup/spike on first touch

Discussion in 'Input System' started by H4ppyTurtle, Mar 26, 2021.

  1. H4ppyTurtle

    H4ppyTurtle

    Joined:
    Aug 20, 2019
    Posts:
    18
    I noticed that in my build for android my app always froze for a second on the very first touch. So I tested this in an empty project and the spike is still there. I am using an entirely empty project and a scene that only contains a camera with the Player Input component. I assigned the Default Input Actions that are shipped with the Input System package as Actions. It seems like a call to NativeInputSystem.NotifyUpdate() is causing this issue. Is this an issue of the underlying system, or is there a way to prevent this?

    Screenshot 2021-03-26 161355.png
     
  2. H4ppyTurtle

    H4ppyTurtle

    Joined:
    Aug 20, 2019
    Posts:
    18
    The multiple calls to Mono.JIT() pointed me in the right direction: When I built with IL2CPP the spike was gone. It seems like with Mono some Input System code needs to be compiled at runtime. This makes the Mono backend not really viable in combination with the Input System on mobile. Maybe the documentation should state this?