Search Unity

Input handling confusion

Discussion in 'Editor & General Support' started by BenSizerRovio, Oct 2, 2017.

  1. BenSizerRovio

    BenSizerRovio

    Joined:
    Sep 25, 2017
    Posts:
    12
    (Following on from this thread, which was closed prematurely in my opinion.)

    Is there any good discussion or documentation on how all the various pieces of input handling work together?

    We have the old Input object, and InputManager for mapping axes and buttons. But there is also the EventSystem, which appears to be able to handle all input in conjunction with EventTrigger, but which doesn't seem to work properly outside the context of the new UI. (I have an EventTrigger in my game and it never gets called.)

    There's the StandaloneInputModule but it seems to only be concerned with objects in the world, rather than tracking input directly.

    Then there is the old Event.current object, but that seems tied in to OnGUI/IMGUI, which most of us aren't using any more.

    I want to be able to handle mouse and touch events at a high level before any objects in the world get to handle it. Old methods like Input.GetMouseButtonDown(0) are not ideal because they're not event-based and therefore multiple bits of functionality can get triggered unintentionally.

    What is the right way to proceed, without resorting to external 3rd party assets?