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

EventSystem Vs New Input System

Discussion in 'Input System' started by VoodooDetective, Mar 21, 2020.

  1. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    238
    Hey there, I was just wondering if the new input system supersedes the EventSystem or are they supposed to coexist?

    Using the event system, I just need to have my classes implement OnPointerClicked() or something like that. I'm wondering if I need to create Player Input component on every object that wants to receive those kinds of messages?
     
    Last edited: Mar 21, 2020
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    The EventSystem component was never responsible for receiving input. That was handled by the StandaloneInputModule.

    You should be able to solve it by replacing the StandaloneInputModule with the InputSystemUIInputModule.

    https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/UISupport.html
     
    VoodooDetective likes this.
  3. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    238
    Ah ok. Just so we're clear, I've been using the event system for both UI and for game objects to detect clicks. I was going straight off the event system documentation. There's a raycaster on my camera, and anywhere (UI or gameobject) i want to detect a click, I implement the appropriate IPointerClickHandler interface.

    So you're saying, that's still the correct/efficient way to do things, but the only difference is that now instead of using StandaloneInputModule, I use InputSystemUIInputModule?
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Yup.
     
    VoodooDetective likes this.
  5. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    238
    Yay!! Thanks.