Search Unity

UnityEngine.EventSystems

Discussion in 'Input System' started by ChrisJohnson, Mar 8, 2019.

  1. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    64
    I was wondering, does EventSystems work with the new input system.

    So will these handlers work, when using the new input system.
    IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerClickHandler, IPointerUpHandler, IBeginDragHandler, IDragHandler, IEndDragHandler
     
  2. dougpunity3d

    dougpunity3d

    Unity Technologies

    Joined:
    Jul 11, 2018
    Posts:
    16
    Yes you can use those. You do have to make sure that your player settings "Active Input Handling" is set to "Both" . Using the EventSystems is a mix of old and new systems. If you take a look at OnScreenButton.cs in the package, its using IPointerDownHandler, IPointerUpHandler
     
    ChrisJohnson likes this.
  3. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    64
    Cool, Right now I have the Active Input Handling set to both, and the handlers are working like you said. But I was wondering if there is a way to get the handlers to work with just the new input system, and if not are they ever going to work with the new input system?
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    There's a new input module (UIActionInputModule) to replace StandaloneInputModule (the legacy input module) with. However, it still hasn't seen a lot of testing and there's issues to be expected. Some further work on it is scheduled. But it may already do the trick for you.

    To use it, remove the StandaloneInputModule component from the EventSystem object and add UIActionInputModule instead. After that, the various actions need wiring up to actually get input. When we've done a pass on this, it'll get simpler. Ultimately it'll hopefully be fully automatic.
     
    ChrisJohnson likes this.
  5. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    64
    Nice, that should work for my purposes. I'm just glad that there is a replacement for the old EventSystem stuff.
     
  6. mdclarinet

    mdclarinet

    Joined:
    Dec 4, 2020
    Posts:
    1
    I am trying to convert the 2D Platformer Tutorial to the New Input System and can't seem to get gamepads to work. I think the old input system is blocking the New Input System from reading the gamepads during gameplay, but I can't get rid of the old input system because the game is requiring old inputs all over the "UnityEngine.EventSystems". Not sure what to do. Any suggestions?