Search Unity

"Pointer should have exited all objects.." - Error

Discussion in 'Input System' started by Studiomaurer, May 6, 2020.

  1. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    Hi,
    After I upgraded to the recent version of the Input System I get the error "Pointer should have exited all Objects before being removed" when clicking. Does anyone know what this is about?

    I'm using a mouse and a virtual mouse (generated from a leap motion) at the same time... the rollovers are triggered just fine, the errors appear when clicking anything, the clicks are visible in the debugger but do not trigger any buttons.
     
  2. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    With some tinkering I found that the Pointerbehaviour of the InputSystemUIInput Module of the EventSystem should be set to "all pointers as is". Multiple pointers work like a charm now, I can use two hands and a mouse simultaneously with my UI...
     
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Any chance you could file a ticket with the Unity bug reporter with the project that triggers that. Regardless of the setup, the assert shouldn't be hit. Looks like the UI module isn't properly cleaning up a pointer.

    Great to hear :)
     
  4. awallick-sd

    awallick-sd

    Joined:
    May 29, 2019
    Posts:
    13
    Hi!

    I'm working on migrating to the new Input System. I was running into the same issue here, except without the virtual mouse. I was also able to stop the error by changing to "All Pointers as Is". However, I then started to notice that my onClick events were firing twice.

    Eventually I traced this back to the "Simulate Touch Input from Mouse or Pen" setting being on in the Input Debug window. Since turning that off, I was able to switch the Pointer Behavior back to "Single Mouse Or Pen But Multi Touch and Track" and no longer see the double onClicks

    One thing to note is we have 2 scenes loaded additively with an EventSystem in each. I was originally suspicious that might be the problem, but wasn't able to get a setup working with just one EventSystem.

    For now we can avoid the use of the Simulate Touch Input setting!
     
    superkerokero likes this.
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Same problem here @Rene-Damm

    New Input System package + Input System UI Input Module + EnhancedTouchSupport + Simulated Touch = Pointer should have exited all objects before being removed
     
  6. DikSanPlay

    DikSanPlay

    Joined:
    Jul 2, 2017
    Posts:
    2
    Have you solved this problem?
     
  7. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    I still have the same problem.
     
  8. DikSanPlay

    DikSanPlay

    Joined:
    Jul 2, 2017
    Posts:
    2
    @bdovaz I finally solved this problem! As it turned out, it was not because of the "Input System UI Input Module + EnhancedTouchSupport + Simulated Touch". It so happened that there was a canvas on my scene, but there was no Event System with Input System UI Input Module. After I added it, the problem disappeared.
    (On my canvas, there were scripts using InputAction with "Press [Touch screen]" binding.)
     
  9. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    In my case the problem it's still there.
     
  10. MollySpryFox

    MollySpryFox

    Joined:
    May 4, 2020
    Posts:
    11
    Same for me: when I turn on simulated Touch, in script and in the options menu pressing a button generates the error:
    Code (CSharp):
    1. Pointer should have exited all objects before being removed
    2. UnityEngine.EventSystems.EventSystem:Update()
     
  11. DatThax

    DatThax

    Joined:
    Jun 18, 2019
    Posts:
    10
    I'm constantly getting this Error. I'm not even using Simulated Touch. I'm testing the app on real android devices and after the first tap/touch, every tap after that throws this error. I have two Canvases in my scene, both without Graphic Raycaster components, as they aren't interactable.

    When dragging my finger over the touchscreen the error happens less often, but still about once a second.

    These are my controls:



    This is my event system:



    Also, I have a game over screen that has a UI button that doesn't work with touch input (works with mouse input though). This is a scene I'm loading additively that simply has a canvas with the UI elements. This canvas does have a Graphic Raycaster, and the button is marked as interactable. I'm suspecting that this error has something to do with the button not working.
     
    qball13z likes this.
  12. RP-develper

    RP-develper

    Joined:
    Jun 18, 2020
    Posts:
    1
    THIS WILL NOT WORK WITH NEW INPUT SYSTEM GO BACK TO OLD INPUT SYSTEM THEN IT WORK THAT ALL I GOT WITH NEW UNITY SYSTEM
     
  13. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    618
    Just ran face first into this as well...

    with Touch Simulation enabled, all of the defaults of Input System UI Input Module just outright fail to work in any consistent manor.

    Once again mobile support is 100% unusable with the new InputSystem :(
    @Rene-Damm This is getting pretty ridiculous... without proper Unity Remote support at first, and now simple "Mouse == Touch" just not working, there is no way to use the new InputSystem with mobile at all!
     
    qball13z and MousePods like this.
  14. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Currently looking into it (ticket). Sorry this wasn't fixed for preview.2.
     
  15. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    looking forward for news here too, same problem.
     
  16. Zathos91

    Zathos91

    Joined:
    Aug 26, 2014
    Posts:
    45
    Unfortunately I have this issue too. Any updates?
     
  17. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
  18. yusefkerr

    yusefkerr

    Joined:
    Apr 5, 2011
    Posts:
    179
    I'm having the same issue, I enabled virtual touch and got the "Pointer should have exited all objects before being removed" error. I can see the project running on my android device, but the touch screen doesn't seem to send input to Unity.

    I have to say this is really annoying, it makes it virtually impossible to test my game without rewriting scripts, or rebuilding every time. Are there any other workarounds?
     
    Last edited: Nov 17, 2020
  19. Vanimalsdev

    Vanimalsdev

    Joined:
    Nov 14, 2018
    Posts:
    3
    Any news about it? I test this problem in a demo project and on a real Android device. If I press a finger on the screen and use another finger to press a button or a image, this error will occurs. But after I change the action type of Click to pass through, the error disappears. But this error still appears in our game project even if I chagned the click action type to pass through.
     
    Last edited: Nov 28, 2020
    qball13z likes this.
  20. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241
    Keeping an eye on this too, have reverted back to the old input system now as this new one, though looking promising does not yet seem quite robust enough but looking forward to giving it another go in the future.
     
  21. abhijit7sivadas2

    abhijit7sivadas2

    Joined:
    Dec 29, 2020
    Posts:
    1
    i got 2 games with the same input system but only one of them shows this error. Changing pointer behaviour helped remove the problem still the touch is not taken in the first instance and takes it only on the second time we tap.
     
  22. xeontem

    xeontem

    Joined:
    Jan 23, 2020
    Posts:
    1
    The issue because of inconsistend "Pointer" device behavior.
    Unity supports huge list of input devices. But according this issue we interested in "Pointer" and "Touchscreen" input methods.

    what I've realized:
    There are two places to configure supported input devices:
    1. New input system config
    2. Project settings

    If to configure supported devices inside "New input system config" it will affect "New input system config" only.
    if to configure supported devices inside Project settings it will affect input handlers assigned using UnityEngine.EventSystems interfaces(like IDragHandler, IPointerClickHandler etc).

    I assume we interested in "Touchscreen" devices only. So that if to set supported devices list everything neccessary to the project except "Pointer" - error will dissapear.

    Try to play with including/excluding "Pointer" input type from supported list in both places("New input system config" and Project settings).
     
    DMorock likes this.
  23. IsometricBacon

    IsometricBacon

    Joined:
    Sep 28, 2017
    Posts:
    29
    Been bashing my head against this all day.

    Seems like if you use any combination of the TouchSimulation - either through the component or the Input Debugger on standard Unity GUI objects it will fire double events. After some digging, I'm pretty sure this is just firing a mouse 'click' event and a keyboard event simultaneously. I was able to catch for this in my input handling code by determining if the devices was from a Touchscreen / TouchSimulation or other devices.

    However - I can't easily catch for this in my UI logic, because I heavily use Unity's standard UI components, and have an interface that needs to handle both Touch and Mouse at the same time.

    Digging further I realised I still get this issue, even with all instances of TouchSimulation removed. Turns out, it is because I have the pointer behaviour in the EventSystem set to 'All Pointers As Is'

    Upon setting this back to any other setting, the touchscreen on GUI objects work as expected... but I just get the continual 'Pointer should have exited' exceptions.

    Unfortunately manually setting accepted devices and excluding the Pointer doesn't appear to fix this issue for me.

    Unfortunately this makes the Input System almost all but unusable, which is really painful given I just spent a good couple of weeks completely rewriting our entire input system around it.

    Any word on a fix or other potential workarounds?
     
    GlennM2H and ltethe like this.
  24. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    587
    I get this error when setting the Input Debug option to add 'Simulate Touch Input or Pen'. Changing the EventSystem to 'All Pointers As Is' makes no difference. However, it's still a bit frustrating that something as simple as simulating touch is not easy to implement with the new InputSystem. Still trying to figure out how to detect a swipe and how to simulate that with a Mouse Drag. That seems like a very common use-case and should 'just work'.
     
    KyryloKuzyk likes this.
  25. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Have you tried the XR Interaction Toolkit? There's a gesture recognition in there and you don't have to use it only for XR
     
  26. Adrien-Gannerie

    Adrien-Gannerie

    Joined:
    Feb 18, 2015
    Posts:
    12
    Hey guys, did you find a solution for that issue ? I'm still have this issue and having a error every press on my app is really really annoying. Apple don't want to push my app on the store due to this error. Any updates or solution @Rene-Damm ?
     
  27. engelhard90

    engelhard90

    Joined:
    Oct 2, 2018
    Posts:
    19
    PUMP - I get the same error when pressing the back button on Android, after that the game freezes and no input is taken anymore...
     
  28. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Any updates? One year has already passed since this.

    I got same exception but only on Android device even for single touch right after OnPointerUp event. Spent all day trying to find a workaround without luck including possible solutions from this thread. It makes the Input System completely broken for me at least.

    EDIT:
    Ok looks like I found the issue. In my case I've used custom input actions asset assigned to InputSystemUIInputModule where Click action has extra interactions and disabled Initial State Check.

    So make sure that your Click action looks like this:
     
    Last edited: Jun 23, 2021
    Voronoi likes this.
  29. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    587
    What version of the Input System are you using? I am using Input System v 1.1.0-pre.5 and I don't have a checkbox for initial State Check. I am getting the message:
    Code (CSharp):
    1. Pointer should have exited all objects before being removed
    2. UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)
    3.  
    4. Foo
    5. UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)
    6.  
    7.  
    Spamming my console every time my mouse hovers over a UI button. I'm using Unity 2021.2.0b1. I just noticed this again after running on the new 2021.2 beta, it seemed like it went away in the latest 2021.1, but not sure about that.
     
  30. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    I'm on 1.1.0-pre.6 but going to revert back since I though the issue was fixed in this pull request.

    As I understand, this exception comes from InputSystemUIInputModule assertion that checks PointerEventData.Enter field for null. According to this thread, there could be plenty of reasons why the assertion fails. Mine was just one of them.
     
  31. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    587
    I believe that my issue was related to opening the Animator tab. Once that is opened, it starts spamming, even after closing. At some point it stops, but then seemed to resume when I used the Animator again.
     
  32. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    587
    Ugg! I could not get this to go away again! I finally tracked down that setting the EventSystem Pointer Behavior to ''Single Unified Pointer" was the culprit. Changing that to "Single Mouse or Pen But Multi Touch And Track" made it go away.
     
    DemTsag likes this.
  33. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    In my case it was the action asset on the event system - input system that was set to the default rather than my input actions controller. Once that was set, and the Simulate Touch Input from Mouse or Pen setting was on, it worked fine.
     
    Arthur-St and Graunarmin like this.
  34. Vladik751

    Vladik751

    Joined:
    Mar 13, 2021
    Posts:
    1
    Try to uncheck the "Simulate touch input from mouse or pen" box, go window->analysis->Input debugger->options.
     
    Entretoize and unity_gyjhezo99e like this.
  35. Graunarmin

    Graunarmin

    Joined:
    Oct 31, 2019
    Posts:
    3
    Thank you so much for this! I had the same problem and this fixed it - so easy when you know it!
     
  36. PuzzleTools

    PuzzleTools

    Joined:
    Jun 16, 2016
    Posts:
    3
    For me, the solution was to Set the Pointer Behavior (In the Input System UI Input Module) to
    'All Pointer As Is'
     
  37. nathan2019spence

    nathan2019spence

    Joined:
    Jan 21, 2022
    Posts:
    19
    Thank you for posting this! I don't have to repeatedly click on the button to get it work, and that error goes away exit pointers....You probably saved me 10 to 15 hours of time.
     
  38. kojiMarunouchi

    kojiMarunouchi

    Joined:
    Sep 25, 2019
    Posts:
    8
    The same error occures, when running a project on "Simulator" of Device simulator. On "Game", this error does not appear. If there is anyone who have already addressed this issue, would you give some advice??

    Environment
    Unity 2020.3.22f
    Project type: URP
    Target: Android & IOS
    Using both new and old input systems

    Settings of event system is in the image below.
     

    Attached Files:

  39. SF_Games

    SF_Games

    Joined:
    Jan 17, 2020
    Posts:
    2
    i get the error "Pointer should have exited all objects before being removed " when i change the input system to "both" in my multiplayer game


    so i follow this method and the error it despaired
     
  40. Dumb_Devel0peR

    Dumb_Devel0peR

    Joined:
    Jan 20, 2022
    Posts:
    1
    Same. Thank you)
     
  41. DSilvandoBlade

    DSilvandoBlade

    Joined:
    Dec 22, 2020
    Posts:
    9
    Hi. I'm having this issue now. I see that a few people fixed it by either turning off their simulated mouse or changing their point behaviour. Yet none of these changes fixed this issue. I do not know what to do since this is the only forum talking about this issue. What can I do?