Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UI Toolkit + new Input Module - hover state not working

Discussion in 'UI Toolkit' started by pawelduda, Aug 10, 2021.

  1. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    45
    I'm using UI Toolkit preview-15 with Input System 1.0.2

    I'm trying to properly set up event system but to no avail.

    With preview-14 we were using both Input System UI Input Module and Input System Event System (UI Toolkit). There was a warning in the console, that two event system should not be active at the same time, but everything worked fine. But now this setup generate error in each frame during runtime:
    So I tried using only Input System Event System (UI Toolkit). But this way
    EventSystem.current.IsPointerOverGameObject(); stopped working - it returns false always. So clicks are passed through the UI into the game.

    So then I tried using only Input System UI Input Module. But this way :hover state in game stopped working.

    Is there a way to make it work properly?
     
    Last edited: Aug 11, 2021
    oobartez likes this.
  2. uBenoitA

    uBenoitA

    Unity Technologies

    Joined:
    Apr 15, 2020
    Posts:
    198
    You need to use at least Input System 1.1.0-pre.5, which is the first version that's fully compatible with UI Toolkit as far as using InputSystemUIInputModule to drive both UI systems.

    You should be able to have access to it by just having a line with
    "com.unity.inputsystem": "1.1.0-pre.5",
    in your manifest.json file.
     
  3. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    45
    Yes, thank you.

    Also in 2021.2.0b5 even without per-release of input system it works fine.