Search Unity

UI Pause Menu Prefab is not working

Discussion in 'UI Toolkit' started by sp33dzer0, Apr 19, 2020.

  1. sp33dzer0

    sp33dzer0

    Joined:
    Apr 21, 2019
    Posts:
    3
    I have created a prefab for a pause menu for game which works fantastically on the scene that I created it in. Unfortunately this prefab does not work properly on any of my other levels. The buttons do not work properly with the highlight on mous eover and are unclickable when attempting to select.

    I have double, triple, and quadruple checked my prefab. Everything that is acting as a point of interest is linked up correctly, and having taken screenshots and compared them side by side they are identical.

    Is this a known issue with Canvas based prefabs? I have not been able to find any information anywhere.
     
    sickb0y247 likes this.
  2. sickb0y247

    sickb0y247

    Joined:
    May 29, 2014
    Posts:
    54
    I have this same exact issue. Works in the scene that it was created but when adding the prefab to other scenes there is no response. Only confirmed with buttons so far but I haven't tried any of the other UI elements yet. Has this been reported or with a workaround?

    Nobody wants to rebuild a pause menu from scratch for every scene. That is ridiculous.
     
  3. sickb0y247

    sickb0y247

    Joined:
    May 29, 2014
    Posts:
    54
    It's definitely the canvas not prefabing properly. If I prefab all of the UI widgets under an empty game object and drag them under a newly made canvas object, they work.

    I've been using the prefabs still but every scene I have to go in and create new canvas objects and drag the widgets into them and delete the old canvas objects for it to work.

    Funny enough, after I've remade the canvas objects and everything is working again, if I delete all of that and drag in the SAME prefab that didn't work for me earlier, it magically works like it's supposed to.
     
  4. sickb0y247

    sickb0y247

    Joined:
    May 29, 2014
    Posts:
    54
    For anyone looking for answers in the future, I got a response from the Unity bug report team. It has to do with the Event Manager. The event manager needs to be included in the prefab and you should be able to nest it within your UI object and it should fix the problem. I
     
    KasiAsa and Eristic008 like this.
  5. KasiAsa

    KasiAsa

    Joined:
    Sep 23, 2021
    Posts:
    1
    add eventSystem