Search Unity

Prefab buttons stopped working since Unity 4.6.1

Discussion in 'iOS and tvOS' started by Umai, Dec 25, 2014.

  1. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    Not sure what happened but another issue since going from Unity 4.6.0 to Unity 4.6.1:

    I have a prefab which is basically a "full screen alert", like an iOS alert. When instantiated it's used to block the entire scree and display a message text and by script I also attach some buttons. Those buttons stopped working, they don't respond to taps at all - since 4.6.1.

    Update: I see that the prefab still works as usual on SOME scenes - I have an intro scene after the splash screen, and the buttons within the prefab work there.
    On the main game scene it still does not work and I did not do any change other than upgrade Unity from 4.6.0 to 4.6.1.

    A bit more what happens: On the game scene, even though I display this full screen alert, the layers behind the alert are the ones that catch the taps. The prefab is designed to take up all of the screen, and as first child of the prefab there is a maxed out dummy button which is supposed to catch all taps so that they are not caught by the below game layer. This does not work now because the alert prefab does not catch any taps whatsoever in the game scene - and in fact I can control game play like had the alert stuff not been there.

    More: It doesn't seem that this is related to buttons within prefabs per se, somehow any button I add last in the canvas hierarchy does not work on this game scene I have. Only the below buttons that are added by the game catch the taps. Those buttons are added way deeper "up" in the hierarchy and should not catch taps if something is added visually on top of them, last in the Canvas hierarchy right?
     
    Last edited: Dec 25, 2014
  2. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
  3. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    After reading through that thread I got the idea to add a Graphic Raycaster component to the main Panel - I set Blocking Objects to Two D and things seem to work again. I guess a Panel does not have a Graphic Raycaster per default but needs to in order to block stuff covered by it... sounds weird and this is probably not by design but a workaround for now.