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

Scrollbar handle disappears

Discussion in 'UGUI & TextMesh Pro' started by Rendolf, Dec 19, 2014.

  1. Rendolf

    Rendolf

    Joined:
    Aug 26, 2014
    Posts:
    19
    Hello,
    I use many scrollbars in my scene. Sometimes their handles disappear and i can't find any reason. Everything is okay and when I run my project next day one of the handle disappears. Their rect transform parameter Top and Bottom are set to NaN. The only way to make it work is to remove scrollbar and create a new one.

    Any ideas why this happens?
     
    unity_uCAh1YGgjxXPOw likes this.
  2. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    I found that everytime I restart unity the scrollbar handles are disappeared
     
    gdbjohnson likes this.
  3. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    I found out a workaround for this. For me, the reason the handle disappeared is due to I link these scrollbars to prefabs. Unlink them from the prefabs fix the problem, though I don't know why :(
     
  4. Rendolf

    Rendolf

    Joined:
    Aug 26, 2014
    Posts:
    19
    In my project all scrollbars are link to prefabs and they doesn't disappear afet each Unity reset, only sometimes ;p I think in my case is something different. Do you use Unity 4.6.1 ?
     
  5. NaurisAndzans

    NaurisAndzans

    Joined:
    Oct 12, 2013
    Posts:
    5
    Same problem here. I've been struggling with it since 4.6 and now I'm running 4.6.1f1. Sometimes my On Click functions wont work either. This happens often, not every time I open some of my projects. So the issue seems not persistent, but very random. If this was indeed a bug in new UI I'd expect more reports on this issue, but this was the only thread.

    I recently worked with patched Unity 4.6.1p2 and as I remember I did not run in to any problems regarding UI, but I had to downgrade back to 4.6.1f1 because patched versions does not support web player projects. Any way try installing patch from http://unity3d.com/unity/qa/patch-releases . Maybe that will resolve the issue.
     
  6. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    Update: I found out that the workaround is not working, they start to disappeared again /.\ Yeah I am using 4.6.1

    Gonna try 4.6.1p4, will tell here if it works.

    Btw, I know how to reset the scrollbar to original position.

    When you click on the handle you will see the recttransform Top and Bottom of the handle is "NaN", follow these steps:
    1. change the Anchor Preset to middle-center (red line cross in the center)
    2. change Pos Y "Nan" to 0
    3. change the Anchor Preset back to stretch-stretch (bottom right corner), make sure the top and bottom is now 0 0, you get back your scrollbar handle!

    btw, this issue is also discussed here:
    http://forum.unity3d.com/threads/ve...p-bottom-becomes-nan-with-scroll-view.285490/
     
    Last edited: Jan 21, 2015
  7. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    Update: I have tried 4.6.1p4, and the scrollbar is STILL DISAPPEARED

    Unity, please help us.
     
  8. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    200
    I have the same problem and reported the bug a couple of weeks ago. Moreover, if that happens, my whole canvas is getting messed up (events not working anymore for example, so my tooltips go to hell) until i don't deactivate the scroll bar. For me it seems to happen only when i change the canvas screen space only so far.
     
  9. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    in my case i have multiple canvas object, some are screen space only but some are link to cameras. but all the scrollbars are inside canvas link with camera.

    the scrollbar problems just messed up my scrollrects and make them cannot scroll properly (it feels like the handle is covered on the whole scrollrect).
     
  10. Drapka

    Drapka

    Joined:
    Feb 3, 2015
    Posts:
    1
    Hello guys, any update on this issue?
    Has anyone reported it? I could not find anything about this problem in the bug tracker.
     
  11. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    200
    Ahaha i just came to the forum to investigate about the same thing cause i realized that it happens sometimes also when i don't even change the screen space of the canvas

    i did report it already several weeks ago i think, maybe it's fixed and ready for the next release
     
  12. bestknighter

    bestknighter

    Joined:
    Dec 2, 2014
    Posts:
    16
    This other thread has some useful information about this bug... Something with the layout components. I'm having these issues to.
     
  13. gdbjohnson

    gdbjohnson

    Joined:
    Dec 16, 2014
    Posts:
    40
    Just wanted to chime in that I am also having this issue. When the Scrollbar goes psychotic, the Handle of the Scrollbar seems to capture all my click events on my Canvas, preventing any UI from working. I could see this from watching the EventSystem while running my app.

    It consistently caused me trouble today, and then magically stopped. Probably will again in the future.
     
  14. unity_uCAh1YGgjxXPOw

    unity_uCAh1YGgjxXPOw

    Joined:
    Feb 10, 2021
    Posts:
    6
    This worked!!! Thanks so much. I don't understand how this issue is still here 6 years later...
     
  15. Jahvan

    Jahvan

    Joined:
    Feb 1, 2017
    Posts:
    10
    If you're changing the size property of the scrollbar in script, make sure it's a valid float. In my case I wasn't accounting for a division by zero; so setting the size gave the handle a NaN position, which would persist even after the size was set to a valid number.