Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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 Deleted User, Dec 21, 2019.

  1. Deleted User

    Deleted User

    Guest

  2. Stephan_B

    Stephan_B

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

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

    Deleted User

    Guest

    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

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    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. Deleted User

    Deleted User

    Guest

    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. Deleted User

    Deleted User

    Guest

    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.