Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Upgrading to Unity 5.2 - UI Problem with Raycast Target

Discussion in 'UGUI & TextMesh Pro' started by TitanUnity, Sep 8, 2015.

  1. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,172
    Hmm ok i'll have to take a closer look at the masking stuff
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    2,960
    Ugh. Glad I found this thread. I thought I was going crazy with this issue.

    Updating to 5.2.1 now.
     
    JoRouss likes this.
  3. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Still got the same problem here. Updated my 5.1 project to 5.2.1f today and the event/raycasting system went crazy. All of the solutions posted here didn't work.
     
  4. jhkimblue

    jhkimblue

    Joined:
    Mar 27, 2015
    Posts:
    14
  5. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Sorry, didn't know there was a patch. The problem has been indeed fixed after upgrading Unity to 5.2.1p1.
     
  6. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    hey, looks like the raycasting problem is now fixed at least for me in the version 5.2.1p2.
    all the gui buttons are now clickable and no rays going thru.

    BUT ! new graphic bug.

    when the Image slicing parameter is not touched the frame is renderd full of garbage.
    looks like it is rendering the whole atlas in full screen.
    so now i have many places showing the whole sprite atlas instead of the slider or sliced image.

    also, some locations there are double times the same sprite Image. center of the screen and the location where it should be. when i modify the color of the sprite while in Play mode only the center of the screen sprites color is changing. The sprite in the correct location is not affected by the color of its color.

    masks might be broken too.

    rolling back to.... some ancient version

    one more edit: 5.2.1p2 crashes in Editor always now when instatiating ui elements from resources. ie.
    GameObject.Instantiate( Resources.Load( "Prefabs/GUI/CanvasAndImage" ) as GameObject );

    works on all older unity versions.
     
    Last edited: Oct 2, 2015
  7. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,172
    Could you file a bug about the crash as thats news to me.

    Also wehn p3 is out give that a try hopefully fixes the issues.
     
  8. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    116
    Possibly one of the worst Unity updates we've tested in quite a while. Rolled back to 5.1.3p3. How did you manage to introduce so many bugs in a minor version? :)

    Tapping uGui buttons is close to impossible when there are layered panels and/or masked images behind. Did not see that problem mentioned in this thread?
     
  9. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    hi @HaakonL :) just wondering if you were able to try the 5.2.1p3 that rolled out today? I just want to make sure we can confirm its solved. Thank you!
     
  10. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    116
    @holliebuckets, I used 5.2.1f1 while testing. Not sure if I want to spend more time on this by downloading p3 etc before you can confirm all graphical glitches, touch issues and sprite issues has been fixed? :)
     
  11. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    116
    @holliebuckets, where is the patch release? I can't find it anywhere. Only a 5.3 beta – which I don't want to check out.
     
    holliebuckets likes this.
  12. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
  13. tellemstevedave

    tellemstevedave

    Joined:
    Jul 15, 2013
    Posts:
    18
    I have similar issue and it doesn't look like 5.2.1.p3 fixes it
     
  14. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Today we installed 5.2.1p3. Good news and bad news.

    The issues we experienced with raycasts / UI button interactions seem to be resolved. The test project I posted earlier in this thread now works.

    We now have a new issue. I've only looked into this for about 30 minutes so far but have yet to explain why our Texture memory has increased to full decompressed size when profiling on devices.

    Everything else being equal, it seems that the compression settings are straight up being ignored. For example, a few our our 2048x2048 packed textures that when compressed would normally use 2mb texture memory now display as 16mb when profiled.

    Any idea why this would happen? It's as if my settings are being ignored.
     
  15. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    This is pretty bizarre, I've tried several things over the past few hours... but can't figure out why a 2048x2048 with RGB Compressed ETC 4bit compression results in 4mb texture after being packed. Previously this would be 2mb. Overall this is resulting in my app running at 2X the texture memory of the previous build in 5.1.3p3.

    Giving up for now, again will be reverting back until more information is available.

    Additionally, if it is of any use, I keep seeing this in the console and can't yet explain. "Failed To Add the asset file size for..."
     

    Attached Files:

  16. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,172
    Yea i'm honestly not sure i'd have to ask the 2D team whats going on as they are the ones responsible for the packing.
     
  17. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    I see 5.2.1p4 have been released. I see that it might address the Failed to Add the asset file error I mentioned, but I don't see anything regarding the other issues. Going to hold off on the update until I hear more.
     
  18. Flybye

    Flybye

    Joined:
    Mar 25, 2015
    Posts:
    100
    This worked for me. Thank you!
     
  19. BFGS

    BFGS

    Joined:
    Sep 28, 2015
    Posts:
    1

    Hi there TitanUnity, I had a similar problem when updated to Unity 5.2.1, It's not a Image resolution problem.... See below..



    This is a NoImage Panel with Black color and Alpha, but for some reason it got a Random Material that I have in my game. The solution was set a White Material (or a white Image), just to put color on it, like below:



    Hopefully this can help someone...
     
  20. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    BFGS, my initial issue you referenced was resolved in the 5.2.1 patches.

    The most recent issue I've raised, and an issue that remains in the latest 5.2.2f1 update is that our texture memory has nearly doubled. Check out this image taken in the profiler while using 5.1.3:

    a sprite-packed 2048x2048 sheet would previously consume 2mb of Texture2D memory:
    To be clear, I'm talking about a sheet compressed for android with the setting 'RGB Compressed ETC 4 bits':

    2D_Texture_Memory_Profiler.jpg

    Once we update to 5.2.2f1, all of our packed textures just increase in memory size. This can easily be reproduced by switching between the projects, and rebuilding. 5.2.2 doubles the Texture2D memory usage over 5.1.3. You can see that our 2048x2048 solid sheets increase to 4mb with no other changes.
    TextureIncrease.JPG

    Definition of my compression from Unity docs:
    RGB Compressed ETC 4 bits Compressed RGB texture. This is the default texture format for Android projects. ETC1 is part of OpenGL ES 2.0 and is supported by all OpenGL ES 2.0 GPUs. It does not support alpha. 4 bits per pixel (32 KB for a 256x256 texture)

    So if I'm understanding this right:
    2048x2084 = 4,194,304 pixels.
    4,194,304 pixels * 4 bits per pixel = 16,777,216 bits
    16,777,216 bits = roughly 2mb

    Should be 2mb, not 4mb? Still no explanation for this... will continue looking.
     
    Last edited: Oct 21, 2015
  21. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Was unable to find an explanation for the Texture2D memory increase. Reverting back to 5.1.3.p3 until we can find an explanation.
     
  22. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Just tryed installing 5.2.2p2 this morning. Still having the same problem where texture2d memory is DOUBLE in size. Can anyone explain this issue? Refer to my posts above for full context

    Reverting back to 5.1.3p3 always correct this problem. We would really like to move to Unity 5.2 but are unable to do so until the memory issue is resolved. Any ideas?
     
  23. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Any response from the 2D team on this issue?
     
  24. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    Hey @TitanUnity :) Could you post your Texture2D issues in a separate thread in the 2D section? I'm going to ping the 2D team, but it needs to be a single topic thread for me to do that :D

    Feel free to @holliebuckets me when you do! Thank you soooo much!
     
  25. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    571
    Dunno if related but 5.3.0b5 has this fix:
    • AssetBundle: Fix the issue that the sprite atlas has been stored twice in AssetBundles.
     
  26. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    holliebuckets likes this.
  27. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    @TitanUnity cool! I've sent a message to the 2D team. They are in Korea so it might be tomorrow, but ya never know :)
     
  28. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    finally you did fix the dynamic font texture issue. it has been there since unity 3?!? now it looks like working in 5.2.2p3, no more 1-frame broken garbage. BUT the Unity 5 is still unusable, now in 5.2.3p3 the sliders are flashing broken. just like the fonts did before, every about 1 second the slider graphics are showing corrupt images.
    and in addition to this, which is broken in Unity 5 also, horizontal groups of buttons, they are showing wrong button hilights. before 5.2.2p3 if you have horizontal group of buttons the first button is always hilighted when hovering over any button. in 5.2.2p3 the last button is now the only one hilighting.
    when can we release anything with unity ? none of the untiy 5 versions are good for any release.

    and another problem also popped up. making spriteless fullscreen clickareas like:
    public class ClickArea : UnityEngine.UI.Graphic {
    protected override void OnFillVBO (System.Collections.Generic.List<UIVertex> vbo)

    is now actually rendering full screen alpha on 5.2.2p3 ! this is horrible on mobiles.

    EDIT: you had the slider clicking fixed in previous 2 versions. now its broken again, when you click a slider with a mouse and move 1 pixel down, the slider jumps to top. on mobile devices this is even more worse, tapping the slider with fingers the slider jumps around crazily
     
    Last edited: Nov 9, 2015
  29. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    :/ this is so frustrating. @johnpine could you please submit a bug report and then post the bug # for me? Thank you so much, and I'm so sorry this has been such an ordeal.
     
  30. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    for the slider clicking issue i submitted ( again ) a test scene: a tracking number: 747600

    the horizontal group of buttons looks like they are working in the latest version 5.2.3f1

    now there a new problem unity crashing each time i switch between visual studio and unity :(
    sometimes it popsup unity crash dialog and sometimes windows popup.
    i will try to get a bug number for it as soon as i get it again.
    it looks like quite easily reproducable.
    change source code, switch back to unity, switch back to visual studio, switch to unity, double double click the same source file, nothing happens, double click again, nothing happnes.
    switch to visual studio theres a dialog saying source code change, click refresh, switch to unity. crash

    i have got unity to crash now 10 times per hour. 5.2.3.f1 didint happen ever before. i am trying to do a repproducable steps
     
  31. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    actually the button layout is also still broken in the lastest Unity. i did an example scene bug id: 747837

    today Unity is not crashing when clicking multiple times a source file to open it to Visual Studio. but it clearly does something weird it hangs for a while. it has something to do with the Visual studio blocking a source file opening when there is a reaload all files dialog open.
    when i click reload all, Unity hangs for a second but not crashing today. Yesterday it crashed every single time. Which is really annoying that Unity since 5.1 ? modifies source files on each Play and Stop. pretty annoying. So every time I press Play and Stop, visual studio opens a dialog saying source files changed, reaload or cancel.

    Definetly doing something with opening a file to the Visual studio in the latest Unity.
    Crashed again, the editor.log is this:

    EditorHelper: Attempting to use Visual Studio.
    EditorHelper: Checking for Visual Studio installations.
    EditorHelper: Searching for Visual Studio 2008 installation using the VS90COMNTOOLS environment variable.
    EditorHelper: Found a Visual Studio 2008 installation here: c:/program files (x86)/microsoft visual studio 9.0/common7/
    EditorHelper: Searching for Visual Studio 2010 installation using the VS100COMNTOOLS environment variable.
    EditorHelper: No Visual Studio 2010 installation found.
    EditorHelper: Searching for Visual Studio 2012 installation using the VS110COMNTOOLS environment variable.
    EditorHelper: Found a Visual Studio 2012 installation here: c:/program files (x86)/microsoft visual studio 11.0/common7/
    EditorHelper: Searching for Visual Studio 2013 installation using the VS120COMNTOOLS environment variable.
    EditorHelper: No Visual Studio 2013 installation found.
    EditorHelper: Searching for Visual Studio 2015 installation using the VS140COMNTOOLS environment variable.
    EditorHelper: No Visual Studio 2015 installation found.
    EditorHelper: Your preferences indicate Visual Studio should be found here: c:/program files (x86)/microsoft visual studio 11.0/common7/tools/../ide/devenv.exe
    EditorHelper: We found a matching Visual Studio 2012 installation here: c:/program files (x86)/microsoft visual studio 11.0/common7/
    EditorHelper: Looking for a running Visual Studio session.
    EditorHelper: We found for a running Visual Studio session with the solution open.
    EditorHelper: Using the existing Visual Studio session.
    EditorHelper: Getting operations API from the Visual Studio session.
    EditorHelper: Waiting for the Visual Studio session to open the file: D:\somewhere\somewhereelse\Unity\All\Assets\Scripts\Debug\test.cs.

    you did some changes to Unity after p4 considering this ? because this never happened before, now so easily crash. still waiting the unitys own crash dialog to popup so i can send a crash data

    ok, now it crashed with Unitys crash dialog, sent a crash logs and dump 1 minute ago.
     
    Last edited: Nov 26, 2015
  32. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    Unity 5.3 the GUI is now broken on Android builds too. Showing some garbage textures about every frame for 1-frame.
     
unityunity