Search Unity

On-screen Joystick sticking on Android

Discussion in 'Android' started by RakkuAmiya, Nov 13, 2020.

  1. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Hi there;

    I'm hoping someone out there can help, as my pc almost visited my pond this afternoon. If I had any hair left, I would have torn it out by now.

    Basically I have a very simple Android project with on-screen joysticks. When using one stick, or two, at some stage the position of the stick will freeze. When there's a second one also on the screen, that will continue working, but that may then also freeze. Even if both are frozen, I have a quit button on one scene and that always works.

    Most recently, I tried a blank scene with Unity's built-in on-screen joysticks, and Ultimate Joystick (from the Asset Store). We are using the new Input System for our project. The problem seems to occur in relation to multiple touches on screen. My suspicion is that a finger leaving the screen event is not being detected, as the behaviour is like just holding your finger still on the screen. I've attached a couple of screenshots.

    I can't find any other reference to this bug being encountered by anyone else, so I'm hoping this is something daft that can be fixed? I have contacted the author of Ultimate Joystick for help also, but I think the fault is Unity side with touch screen events and a project setting maybe?

    My pc doesn't have a touch screen, so the fault has never occurred while using the mouse as a finger. It occurs when the apk is sent to my phone and runs there. In my case it's a Samsung Galaxy S8. I'm not sure what phone my fellow developer has, but I know it's not a Samsung. I will check just in case...

    Thank you in advance for your help. :)

    Graeme
     

    Attached Files:

    MaykeBr likes this.
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
    Just in case, you're using this https://docs.unity3d.com/Packages/c...ystem.EnhancedTouch.EnhancedTouchSupport.html , right ?
     
  3. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Thanks for the reply Tomas. No I didn't know about that, so I have enabled it, and checked with a debug message that it is enabled. However the result is the same, with Unity's built-in on-screen sticks and Ultimate Joystick. I can have both sticks firmly stuck within about 10 seconds of use. The profiler is showing further touches taking place, but they just don't affect a stuck control. :(

    I'm going to switch back to the old Input system and see if that works.

    Graeme
     
  4. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    I reverted the project to the old Input Manager and, while there's no built-in on-screen joysticks I can find, Ultimate Joystick is working perfectly. I also tried the new Input System with a blank project, just the on-screen joysticks, and it still kept getting stuck after moderate use on my phone.

    The closest I got to reliability was with the example on-screen controls scene in the Input System package. That behaved itself, but occasionally the control would stick when releasing your thumb from the joystick. However, when you pressed it again it would function. I copied those objects back to my scene, and they functioned the same. However I really wanted the joystick to centre when your thumb released, without fail.

    For now, for reliability, I'll use Ultimate Joystick with the old Input Manager - unless there is something else I missed with the new system?

    Graeme
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
    It's possible Ultimate Joystick is incorrectly using new input system, since if it uses uses https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/manual/Touch.html#touchscreen-device class directly, then that might be have unexpected results
     
  6. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Thanks Tomas;

    Yes the author has replied saying that the new input system isn't fully supported. However, the reason I bought the asset in the first place was because of the 'sticking' issue with the built-in Unity on-screen joysticks, so the issue was present for us before importing Ultimate Joystick.

    Are there any glaring project settings/canvas settings that would be a good place to start?

    Graeme
     
  7. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
    Can you elaborate what do you mean by "the built-in Unity on-screen joysticks", because if an API provided by Unity doesn't work, then it's a bug Unity should fix.
     
  8. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Hi Tomas;

    To verify this, I just made a new Unity project in 2019.4.15f1 using the "Mobile 3d" template, and changed the platform to Android. I then installed the new InputSystem via Package Manager, imported the examples for "On-Screen Controls" and "Touch Samples", and opened the "OnScreenControlsSample". So yes I was using the Unity provided "On-screen joystick" script.

    I had to make the controls bigger, as they were too small on my Samsung Galaxy S8 screen. I then sent this scene to my phone to test, and I was able to stick the controls as above. i.e. quote: "The closest I got to reliability was with the example on-screen controls scene in the Input System package. That behaved itself, but occasionally the control would stick when releasing your thumb from the joystick. However, when you pressed it again it would function and reset to centre, etc."

    My fellow developer is using a Samsung Galaxy S9+. We've both experienced this fault. I tried adding a small script to enable "EnhancedTouchSupport", but it didn't affect how it worked.

    I had been thinking there was a bug in our project, but making a new project and using the Unity example has me wondering now. Is there any step I missed setting up this new project?

    Many thanks;

    Graeme
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
    Could you please report a bug, so it would be on the input system's team radar. If you can please attach a repro project.

    You can paste a case number here.

    Thank you.
     
    RakkuAmiya likes this.
  10. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Thanks Tomas;

    Sorry I've been working outside today. I've just submitted the bug report, and the email I got back had the case number: 1293929.

    Many thanks;

    Graeme
     
    Tomas1856 likes this.
  11. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    I know Covid has caused all sorts of issues for those in work. How long do they normally take to reply? Nearly a fortnight now, which for Pro is pretty uninspiring.

    Graeme
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
    It seems it was not processed by QA yet, I'll try to poke someone to take a look.

    Sorry for the inconvenience
     
    neroznikovyury likes this.
  13. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    Thank you Tomas;

    I did get a reply. Sorry I didn't reply here sooner. It's a known issue since August, and still awaiting a fix.

    2019.4.17f1 hasn't resolved it so far. We can still develop our project, but I wouldn't release anything with the sticks misbehaving. That'll be a while away anyway!

    Merry Christmas and best wishes for the New Year!

    Graeme
     
  14. pandarkstrannik

    pandarkstrannik

    Joined:
    Mar 12, 2020
    Posts:
    1
    Hey, I got exactly the same bug with the stick (even on the latest version of the new unity input system), did anyone find solutions?

    PS: sorry for my english, i'm russian
     
    MaykeBr likes this.
  15. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    It's a known logged fault, that is still present in 2019.4.19f1. Given the popularity of mobile platforms I'm frankly gobsmacked that a bug from August is still present. :(

    Graeme
     
    MaykeBr likes this.
  16. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,916
  17. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    "Fix in Review" doesn't fill me with joy at all ... but I'll give it a try!

    Thanks. :)

    Graeme
     
    Polyfemos likes this.
  18. MaykeBr

    MaykeBr

    Joined:
    Dec 21, 2019
    Posts:
    9
    Yeah, I got the same problem...
     
  19. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    The fix above ^^ (input system package 1.1.0-preview.3) actually solved our issue. No more sticky joysticks!

    Graeme
     
    MaykeBr likes this.
  20. ZenOwl

    ZenOwl

    Joined:
    Oct 14, 2018
    Posts:
    5
    Well, here I am in 2023 using latest 2022.3.1f1 and I am using just the On screen Joystick (Unity) and it is sticking after a few moves.
    Settings: Left Stick [gamepad] Relative position with static origin (otherwise it doesn't move after the first "move" tap/click/point), range: 36 and no tick mark on Isolated Input Action. I will now dive into other forums and go look at the bug reports.
     
  21. Realskull

    Realskull

    Joined:
    Nov 27, 2019
    Posts:
    9
    Did you find a solution? I am still having same problem in 2023 alpha