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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

2019.2.17f1 - Problem with creating TestMesh Pro buttons on a scene that already contains a canvas

Discussion in 'UGUI & TextMesh Pro' started by APSchmidt, Dec 21, 2019.

  1. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    In which version of Unity are you observing this behavior?

    Can you provide the steps to reproduce this issue?
     
  3. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    Uh, you didn't read the title? No, I didn't just modify it.

    How to reproduce? Create a button, configure it like on the image below and see if it works without the EventSystem game object. It doesn't for me and I have tried many times, including creating new buttons from scratch.

    Capture.JPG
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The EventSystem is automatically added when a Canvas is created.

    The EventSystem is a required component for buttons and the likes.

    P.S. Looking into the not added part right now.
     
    Last edited: Dec 22, 2019
  5. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    So it seems.

    I don't know what's happened but it wasn't when I created my buttons. I had a canvas on the scene that for some reason didn't have an EventSystem object and apparently Texts do not need event systems because mine worked fine.

    When I created the buttons, the missing event system game object was not created although it was missing.
     
  6. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    I can confirm this behaviour. I already have a canvas on my scene; I wanted to create another UI independent of the existing one. To do so:
    • I created a new empty game object,
    • inside that empty game object, I added a UI image: a new canvas was created but the event manager was not (not a problem here),
    • I then added a TestMesh Pro button: the event manager was not created and the button is inert (which is normal since the event manager is missing),
    • adding a new event manager doesn't work because there is already one on the scene; I had to duplicate the existing object and move it to the new Ui so that my new button works.