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

Question Conflicts with EventSystem

Discussion in 'UI Toolkit' started by rc31, Aug 4, 2022.

  1. rc31

    rc31

    Joined:
    Mar 12, 2016
    Posts:
    11
    Hello,

    I have an issue with UIToolkit and the EventSystem component. When the EventSystem is enabled, UIToolkit does not capture any events. It works fine when the EventSystem is disabled.
    I'm working on a big project with a lot of resources and packages as CurvedUI. Could one of these packages be the reason why UIToolkit does not work with the EventSystem ?
    In the project we need to use all 3 types of UI (classic, curvedui, uitoolkit)

    Here an example :
    - Start a scene with classic UI and EventSystem
    - Load UIToolkit scene in additive => UIToolkit does not work
    - Disable EventSystem => UIToolkit works
    - Enable EventSystem => UIToolkit works (most of the time ?!)

    I tried to reproduce the issue on an empty project and UIToolkit seems to work fine with or without the EventSystem...

    I'm a bit lost at this point.

    Thanks for your help !
     
  2. noirb

    noirb

    Joined:
    Apr 10, 2014
    Posts:
    84
    It might depend on your platform. We've had issues with certain events not working correctly on Linux if an EventSystem was enabled in the scene, and as a result we're working hard to migrate away from UGUI entirely (but this is difficult since we will have to re-implement some third-party UGUI-based libraries ...).
     
  3. uBenoitA

    uBenoitA

    Unity Technologies

    Joined:
    Apr 15, 2020
    Posts:
    198
    Hi guys,

    Could you describe what's not working, specifically, so we can see if we can create bugs for it and try to fix it? Also, do you have a StandaloneInputModule on the same GameObject as your EventSystem component? If so, is it setup in a special way in your project, or just using the default values? Ultimately we may need to have your project (or a simplified project where the problem happens) to help you and find what the problem seems to be.

    At present time we're not aware that UIToolkit + UGUI has problems on Linux, but if it's the case then we definitely want to know about it. Thanks for reporting the issue!
     
  4. rc31

    rc31

    Joined:
    Mar 12, 2016
    Posts:
    11
    Thanks for your answers

    One person of my team found that the issue is caused by 2 EventSystem at the same time in play mode.
    So, nothing to do with other packages in the project.
    As we use additive scenes, we did not see that until now. (It worked well before adding UITollkit part)

    I can not give you more details for the moment. I could ask for precisions to the person who found the solution if you are intersted.
     
  5. rosco_y

    rosco_y

    Joined:
    Aug 3, 2016
    Posts:
    31
    I'm having a problem that sounds like it might be related. The IPointerClickHandler and related interfaces (i.e., Move, Capture, Down, Up, Capture, Enter, and Exit Handler Interfaces) all work until I place a Visual Tree Asset on a UIDocument in my scene. even if my Visual Tree Asset contains just a couple of Labels.
     
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,842
    I already explained this in the other thread. You need to set the picking mode of any visual elements you want to click through to
    PickingMode.Ignore
    . Otherwise they will eat up mouse inputs.