Search Unity

Bug Is it possible to create a UI button prefab?

Discussion in 'UGUI & TextMesh Pro' started by AlanMattano, Oct 5, 2020.

  1. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,362
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,594
    @AlanMattano

    "When I enter in prefab mode I'm not able to drag and drop a game object from the inspector to assign it to the event OnClick of the button."


    Do you mean you can't drag some object from scene or from prefab itself to some field in prefab?

    You can drag any of prefab's component just fine to button component's onClick...?

    But you can not link scene content to prefabs. This works the same way for all the assets...
     
  3. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,362
    Yes
    Yes
    Yes
    Bug by design. Using U2018, 2017, Unity5 4 Prefab system was fine.
    Is more noticeable in a UI button. how do you connect it?
    Is it possible to make a UI button Prefab?

    If so is a major bug by design.
     
    Last edited: Oct 6, 2020
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,594
    @AlanMattano

    I use UI prefabs all the time. You simply can't refer to scene objects.
     
  5. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,362
    So the new Prefab system became now so complex that I can't make a button?
    To make my Ui button work, I end up unpacking the prefab completely and not using a prefab.

    How do you link to the prefab UI button event a script if you can't drag and drop it?
    upload_2020-10-6_14-23-54.png
     
    Last edited: Oct 6, 2020
  6. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,362
unityunity