Search Unity

Unity UI UI Button Issue after upgrading to 2017.1

Discussion in 'UGUI & TextMesh Pro' started by Denchyaknow, Aug 16, 2017.

  1. Denchyaknow

    Denchyaknow

    Joined:
    Aug 4, 2015
    Posts:
    31
    Hey guys I ran into a problem after I upgraded my project from 5.6 to 2017.

    Everything seems to work fine except I am unable to click buttons nor does the on mouse over work and i cant figure out why.

    [UPDATE]

    Turns out the buttons work after I set all canvases to render on screen space overlay not camera screen space.
    Dont know why it's like that but itll work for now.

    [UPDATE]

    Things I tried:
    Adding in a replacement eventsystem. Multiple event systems,
    Replacing the button component and linking the function.
    Adding canvas groups everywhere
    enabling and disabling graphics raycasters
    enabling and disabling interactible option.
    enabling and disable raycast target on images.
    making sure childed images have raycast target enabled.

    Here is the inspector of a button that current works and is under my Scroll Menu GameObject

    upload_2017-8-15_19-3-55.png

    As you can see the button turns red on mouse over and the click function works
    However the button below it (ClearData)s inspector looks similar

    upload_2017-8-15_19-6-28.png

    Like so and does not do any On mouse over transition nor does its Submit event work.
    This is the same for other buttons as well though for some reason a few buttons seem to work. and only a few.


    has this happened to anyone else? any remedies to fix without having to rebuild my whole canvas?
    Anything I should try? Any tips and help appreciated, thanks!
     
    Last edited: Aug 16, 2017
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    If you found a bug or regression in Unity, I recommend to submit a bug-report following the advice in this document to help that is does not continue to occur in future versions.

    Using the bug-reporter seems to be an important step, because it makes sure the report is in Unity Technologies bug-tracking pipeline and has to be processed at some point. Using the forum is often used to add to a little more attention to a submitted bug-report, but does not replace submitting it first.

    It's from advantage to attach a project to the bug-report that UT can use to reproduce the issue and test their fix against. The easier an issue can be reproduced by QA, the more likely it is to get forwarded to a developer, who might or might not work on a bug-fix for that at some point.

    After you submitted the bug-report, you receive a confirmation email with a Case number. UT often asks us to post the Case number in the forum thread, which allows them to find that bug-report if they look at your post.

    Following these steps will increase the chance that UT is looking at your issue tremendously.
     
  3. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    make sure your Z scale is 1
     
    Last edited: Sep 30, 2017
    healy_barry_IRL likes this.
  4. healy_barry_IRL

    healy_barry_IRL

    Joined:
    Feb 19, 2016
    Posts:
    10
    Thanks for the Z scale =1 tip. Works perfectly for me now! Just saved my whole app! Serious karma for you my friend!
     
  5. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    Glad to help :) .
     
  6. Ciryus

    Ciryus

    Joined:
    Sep 17, 2012
    Posts:
    38
    Hi, same problem here with World Space Canvas. The Z scale tip doesn't work here.
    None of my UI elements placed in my World Canvas seems to receive any event. My Event Camera is the only Camera in the scene. Any hint on that issue?
     
  7. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    I tried checking it by converting my canvas to world space and it is working fine ( Buttons are still clickable ) . Make sure the Z scale of everything is 1 ( canvas , buttons , etc ) . I noticed if i change my canvas Z scale to 0 my buttons stop working ( even though button Z scale is 1 ) so recheck your canvas Z scale , probably thats what is causing the problem :)
     
  8. cwoh

    cwoh

    Joined:
    Oct 6, 2015
    Posts:
    17
    did so --> :-( not working )
     
  9. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    When your buttons do not work, or they only work on the bottom half as they are misaligned on a raycast, you can resolve this when using Screen Space - camera on your Canvas render mode, by making sure the field of view is set on your camera to as high as you need it, enough so you see your GUI within the camera preview. You will now find your buttons work perfectly when you click them.
     
  10. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Example; You will need to test the buttons work at runtime and adjust the camera so it aligns with your camera view, and adjust Field of View of the camera until it fills up your camera preview, I set it to 152, when I set it to 156 (only 4 off, the buttons didn't work) so adjust it until they work, then set it when you come out of runtime as it will not save the value. camera.jpg
     
    Last edited: Mar 31, 2018
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Having said all that, what works in the Editor, doesn't work on a build - so no doubt its bugged or we are doing something wrong :)
     
  12. cwoh

    cwoh

    Joined:
    Oct 6, 2015
    Posts:
    17
    Many Many things dont work after Update ---> not realy professional
     
  13. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    My issues we're resolved as long as I don't hide the buttons and enable them at runtime.