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

Warning to Windows 8 users.

Discussion in 'UGUI & TextMesh Pro' started by yoonitee, Dec 14, 2014.

  1. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    If you are thinking of using the new GUI (4.6) or replacing your own working GUI with Unity's new system. My advice is:

    DON'T!

    Reason: There are many many bugs with this on a Windows 8 touch screen PC. And there is nobody in Unity fixing these bugs at the moment as they are all working on Unity 5 I have been informed.

    I have been an idiot and put time and effort into making apps with the new UI assuming (after all the Windows 8 competitions on Unity) that the UI would at least work for Windows 8 PC store apps.

    Now I will have to discard all the new GUI because it doesn't work and has tonnes of bugs and either use something from the asset store or have to write my own.

    What I am annoyed about is nowhere on the Unity web pages does it say, don't use the new UI to make apps for Windows 8 PCs.

    I am trying to find an email address for the Unity representative at Microsoft to inform them of this shambles.
     
  2. William_Lee_Sims

    William_Lee_Sims

    Joined:
    Oct 11, 2014
    Posts:
    40
    I'm curious to hear more about this. I'd like to hear what specific bugs you are seeing.

    I've been writing games for multiple people to play around one monitor. I've been using sprites and products from the Asset Store to handle my multi-touch input so far.

    I just started a new project using the 4.6 UI. I've not been worrying about the touch aspects so I've not tested it on the real hardware yet. I'll get the game in a testable state today and let you know what I see.
     
  3. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Posts:
    153
    Can confirm. Windows 8 support is a nightmare. I pulled the plug when Visual Studio Pro gave me the intellesence support of notepad.
     
  4. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    I've submitted these bugs among others:
    1. Error when press backspace in Text Input
    2. Can't reposition cursor in Text Input
    3. On-screen keyboard doesn't work
    4. Can't highlight/select text with mouse or touch in text input.
    5. On-screen keyboard won't close
    6. Sliders don't work with touch
    7. Touch "passing through" controls to those underneath using "Pointer Down" event
    The main one I'm concerned with is the Text Box doesn't work with Windows 8 Metro Store apps. It is completely useless. Windows 8 apps are designed to be used with touch. It's a complete shambles.

    The responses I got from Unity are:

    "Windows 8 developers are not fixing any bugs for Unity 4.6 they are working on Unity 5"
    "The code for touch and mouse are different and we don't know how to make it work with a touch screen PC."

    Like I said Unity has no intention of fixing these bugs for the foreseeable future. I am trying to contact Microsoft to make them sponsor Unity to fix these bugs because it can't be good for them either. The worst thing is it would only take one person a few days to fix these bugs! Just get a touch screen PC with Windows 8.1 and fix them!

    I despair. \:confused:/
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    So upgrade to Unity 5.

    I didn't see any mention that unity doesn't want to fix these bugs, only that future upgrades will be on Unity 5.

    So basically you haven't coded any touch related stuff and you expected the mouse to just work?

    Are you following mobile practises/guidelines as those would be the same given touch screens etc..
     
  6. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    They told me when replying to a bug report that they are not going to fix them. With the excuses given.

    So basically you haven't coded any touch related stuff and you expected the mouse to just work?

    What are you talking about? Yes, I expect that if I put in the new GUI and compile it for a Windows Store app it should work with touch and not (as it does now) partially work with errors popping up.

    Also I expect the Text Input to WORK full stop. Not as it does now not even work with a mouse. And giving an error when you press the backspace key.

    I want Unity to give me solutions. Because it's not MY fault it doesn't work. It is Unity's fault.

    Telling me to upgrade to Unity 5 which isn't even out yet and is till in Beta is... well... I don't know what to say.

    Stop trying to blame me. The GUI doesn't work for Windows 8 Store apps.

    Putting a text input in an empty project, compiling it for Windows store and testing it, shows that it is broken.

    Don't be an apologist for Unity. Be on my side. And help me lobby Unity to fix those bugs!

    Or otherwise join me in warning other people that it doesn't work!

    My best solution is NOT to upgrade to Unity 5, but to ditch the GUI (which doesn't work on Windows Store apps) and code some GUI in XAML perhaps.
     
    elias_t likes this.
  7. William_Lee_Sims

    William_Lee_Sims

    Joined:
    Oct 11, 2014
    Posts:
    40
    Thanks for the info!

    I tried my game and it seemed to be working until I tried adding sliders. I could get one slider to work, but not both at the same time. (I double-checked that I allowed touch on standalone.) I looked through TouchInputModule.cs and ExecuteEvents.cs at BitBucket but couldn't see anything that would cause this to happen.

    This is incredibly frustrating given the number of hours I've put in to using the new UI system. Multi-touch is the core of my games. Personally, I'll probably look further into why 4.6 isn't working but I'll probably go back to an Asset Store solution.
     
    yoonitee likes this.
  8. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    this warning is just for touch input right? .. not windows 8 totally??
    .. lol i have windows 8, but i wasnt interested in touch screen.. dont have one.
    lol i got a few programs to make win 8 more like win xp,

    but yeah.. customers would like touch support i guess..

    so OnGui works with touch ? ... lol ive put 0 thought into touch support, cause ive like NEVER used touch.. i dont even have a smart phone, lol, i have a cheapy tablet i hardly ever use though.
    ... tablet so cheapy.. i guess it wont even compile an android game >< LOL and the wires inside are held together with hand ripped masking tape (from manufacturer) LOL
     
    Last edited: Dec 15, 2014
  9. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Well last time I checked, the Text Input control was broken for mouse as well. E.g. errors in console when press backspace key, not able to position cursor or selection text. And if you accidentally do touch the screen on your touchscreen PC all sorts of errors occur. The only GUI that works to some extends are the buttons, but even there I've seen bugs where they highlight when not clicking on them. So if you use the GUI and stick ONLY to buttons you may get away with it.

    Make a simple project with the Text input and try for yourself what you think.

    If you release a Windows 8 Store app with Unity you will probably get irate customers saying things like "I touched the screen and the on-screen keyboard won't disappear" and things like that.
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Do you have case numbers for these problems?
     
  11. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Glad you asked:

    648513 (See it is closed but not fixed!)
    651610 (closed but not fixed)
    651626 (open)
    652851 (open same)
    656630 (just submitted out of frustration)
    650407 (closed but not fixed)

    See it says it's a known issue that it doesn't work with touchscreen PCs. But they are not fixing it nor are they telling anyone about this! That's why I am warning people in this post!

    "we have a known issue, that UI doesn't respond correctly to touches if any physical mouse or keyboard is attached."

    But it is not just touchscreen PCs. The Text Field not functioning correctly for Windows Metro even with mouse.
     
    Last edited: Dec 15, 2014
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Note, you should post full links like that, because other users can see sensitive information in those bugs. Post only case number, for ex., Case 648513, etc
     
  13. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Those bugs were closed, because you didn't respond to them.
     
  14. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Why don't you just sit someone down with a touchscreen PC and do some testing on the GUI. You will find all the bugs in about 1 minute. Surely someone must have a touchscreen PC at Unity? That's what I don't understand. It's elementary testing.

    Or, alternatively, just put a little note on your website that says "Unity 4.6 - new UI! Although it doesn't work on touchscreen PCs". Then at least people know.
     
  15. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Let's differentiate two problems here:
    * Touches on Windows Standalone
    * Touches on Windows Store Apps

    Because these are two different things, touch input for Windows Standalone is not supported in 4.x, touch input on Windows Store Apps is supported.

    We'll look at the problems with touches on Windows Store Apps, though I haven't heard of any problems from our QA, maybe they missed something.

    As for touch input on Windows Standalone, this is only be supported from 5.0.

    Will get back to you as soon as possible.
     
  16. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Thanks.
     
  17. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    78
    I hate piling on for these kind of things, but...
    I'm a unity5 customer and still working and using the unity4.6 UI. This page: http://unity3d.com/unity/whats-new/unity-4.6
    ...is really kind of misleading in this case. It mentions "touch" 6 times but doesn't qualify it with "only on windows store apps".

    For instance, I read the following from the release notes of 4.6 and I think any reasonable person would now be taken aback that touch doesn't work on windows standalone:

    "Built-in controls for buttons, sliders, scroll views, input fields and more have been designed for full cross platform deployment, supporting touch controls and mouse as well as directional navigation such as arrow keys or gamepad controls."
     
    shaderop and elias_t like this.
  18. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Agreed, I'll talk to the right person for fixing this
     
    yoonitee likes this.
  19. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Hi, ironically, standalone PC is one of the ones that DOES work OK with touch! (Probably because the OS interprets touch as mouse controls for a standalone app).

    By the way, I have a feeling that most of the bugs I outlined may be due to the one I outlined for the web player: (https://sites.google.com/site/bugsexposed/pointer-up-touch-bug).
    Specifically it is not calling a pointer down event except when starting dragging. (Perhaps this is a bug in the touch event handler?)
    This would explain why the sliders don't work for touch and you can't select text in a Text Field. But then again the sliders work with touch in the web-player, so do the text fields just not for app store so maybe not.

    Webplayer works fine with touch except for this one little issue I outlined as far as I can see.

    So I guess have a look in TouchInputModule to see if it is calling Pointer Down for a touch down event in Windows? I guess that's where the main problem lies. Is it open source? Can I look in there to fix the bug myself?

    I'm sure it'll turn out to be a simple bug! Perhaps a #define in the wrong place or an enum in the wrong order!

    I reckon the bug will be in GetTouchPointerEventData(..) probably not returned "pressed" on the first touch down. I haven't checked this though.
     
    Last edited: Dec 15, 2014
  20. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
  21. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
  22. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,181
    That function lives in:
    UnityEngine.UI\EventSystem\InputModules\PointerInputModule.cs
    and is not native.
     
  23. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Thanks. Well I can't see any bugs in it offhand... I may have to leave it to the experts to fix.

    If I make changes and then update to the latest copy of Unity presumably those changes will be lost so I should make a backup?

    Do I have to download these source files? They don't seem to be installed with Unity.

    The assembly browsers giving me this:

    Code (CSharp):
    1. protected PointerEventData GetTouchPointerEventData (Touch input, out bool pressed, out bool released)
    2. {
    3.     PointerEventData pointerEventData;
    4.     bool pointerData = this.GetPointerData (input.get_fingerId (), out pointerEventData, true);
    5.     pointerEventData.Reset ();
    6.     pressed = (pointerData || input.get_phase () == 0);
    7.     released = (input.get_phase () == 4 || input.get_phase () == 3);
    8.     if (pointerData)
    9.     {
    10.         pointerEventData.position = input.get_position ();
    11.     }
    12.     if (pressed)
    13.     {
    14.         pointerEventData.delta = Vector2.get_zero ();
    15.     }
    16.     else
    17.     {
    18.         pointerEventData.delta = input.get_position () - pointerEventData.position;
    19.     }
    20.     pointerEventData.position = input.get_position ();
    21.     pointerEventData.button = PointerEventData.InputButton.Left;
    22.     base.eventSystem.RaycastAll (pointerEventData, this.m_RaycastResultCache);
    23.     RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast (this.m_RaycastResultCache);
    24.     pointerEventData.pointerCurrentRaycast = pointerCurrentRaycast;
    25.     this.m_RaycastResultCache.Clear ();
    26.     return pointerEventData;
    27. }
    It worries me this 0, 3 and 4. That could cause confusion unless the assembly browser is converting enums into intgers.
     
    Last edited: Dec 17, 2014
  24. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Possibly one issue might be on Windows 8 store, a touch event will trigger both a touch AND a mouse event. So what I usually have in my code is:

    if(Touch.touches>0){
    //do touch stuff or mouse events that are interpreted as touches by the OS
    }else{
    //do mouse only stuff or touch events that are interpreted as mouse events by the OS
    }

    That way you won't get both the touch module and the mouse module triggered by a touch or mouse event.

    If this is happening a touch could be interpreted as a double click if it triggers both a mouse and touch event!

    Therefor my guess for a fix would be to but in

    Code (CSharp):
    1. GetMousePointerEventData(){
    2.  
    3. if(Touch.touches>0) return null;
    4.  
    5. //rest of code
    6.  
    7. }
    That would be my first guess for a fix. I guess I'll have to download the source code to try it out.

    I am informed that there are two groups at Unity. One working on mouse platforms like PC and Mac, and one working on touch platforms like IOS and Android. But no-one working on touchscreen PCs yet... but they said they are going to try and fix that in a later version of 4.6.

    Also there is not need for all the code about activating the various modules. Just have both touch and mouse modules activated. And only check for mouse commands if there are no touch events happening.

    I don't know.

    I can't fix it. :( Probably a bug in GetPointerData somewhere...
     
    Last edited: Dec 17, 2014
    MrEsquire likes this.
  25. Artiom-K

    Artiom-K

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    8
  26. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Ah, so that explains why a game working everywhere else would crash as soon as I would click on the app window.
     
  27. Artiom-K

    Artiom-K

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    8
    Did setting simulation to false solved your issue? And it shouldn't crash anyway. Do you have a case #?
     
  28. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Yes, I submitted it yesterday but they haven't reviewed whether they are going to accept it yet. I will get to try your workaround tomorrow.
     
  29. Artiom-K

    Artiom-K

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    8
    Could you paste a case #? I'll review it myself.
     
  30. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    There is no case number yet - just an auto-reply saying they'll check to see if they will assign a case number because the Bug Reporter crashed attempting to send them the bug.
     
  31. Raimis

    Raimis

    Joined:
    Aug 27, 2014
    Posts:
    160
    The last post is really ironic :)
     
  32. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Well not really I checked & the system did assign a case number. Not the same thing as taking the case. However if you were talking about their bug reporter crashing trying to report a bug well... :)
     
  33. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I tried the suggested fix & it doesn't fix my problem so my problem with Windows Store 8.1 is something else. :-(
     
  34. InsideJC

    InsideJC

    Joined:
    Nov 12, 2014
    Posts:
    5
    So I recently ran into this issue this past week with a demo application my company is making. Fortunately, it is simply a proof of concept so it is quite small, but we ran into the issue where touch was passing through the UI onto our 3D scene. The solution I came up with was to grab the Canvas object and use its GraphicRaycaster Component to detect if touch was on a UI object:

    Code (CSharp):
    1. private bool IsPositionOverUICanvas( GameObject canvas, Vector2 position )
    2.     {
    3.         var rayCaster = canvas.GetComponent<GraphicRaycaster>();
    4.  
    5.         var data = new PointerEventData( EventSystem.current );
    6.         data.position = position;
    7.  
    8.         var list = new List<RaycastResult>();
    9.         rayCaster.Raycast( data, list );
    10.  
    11.         return list.Any();
    12.     }
    In my solution I simply added a tag for every root Canvas and use 'FindGameObjectsWithTag' to loop through each Canvas based on mouse position or touch. I hope this is either helpful or leads someone to a more helpful solution
     
  35. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks.