Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

InputActionCallback Allocations

Discussion in 'Input System' started by tarahugger, Feb 21, 2020.

  1. tarahugger

    tarahugger

    Joined:
    Jul 18, 2014
    Posts:
    129
    I was looking at the profiler and noticed that only some of my InputActionCallbacks have an allocation.

    Its strange because it only happens with one of my Actions, every instance of my 'Player/Point" action has this happening, but every other action is zero, despite them all being bound do the same delegate (which does nothing). This seems to be happening somewhere before my delegate is being called. Any thoughts?

    I'm evaluating if i need to avoid events altogether and switch to manual polling due to performance issues.

     
  2. tarahugger

    tarahugger

    Joined:
    Jul 18, 2014
    Posts:
    129
    Turns out InputSystemUIInputModule.GetMouseDeviceIndexForCallbackContext() is to blame. Any UI action set to passthrough will cause this.

    But, its coming from a string interpolation in Debug.Assert, so nothing to worry about.
     
    Last edited: Feb 22, 2020
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    This should be fixed as of 1.0.0-preview.5.
     
    tarahugger likes this.