Forum rules - please read before posting.

Creating new UI canvas causes direct UI control to stop working...

As per the title, I had implemented the direct UI control, and ensured that the first element selected was the first button of my pause menu. This worked just fine, and I'd managed to get the beginnings of a mouse-and-keyboard game going, with anything vital being handled by the keyboard. 
However, when I started to construct a new UI, the first menu item was no longer selected in the pause menu. After click-and-releasing, the UI could be navigated with the arrows/XBox controller, but it no longer highlighted the first item in any menu automatically. I performed a few tests, and found that the moment when this occurs is after creating a new UI Canvas in a scene. After that, the direct control of menus no longer works. 

If the scene hasn't been saved, then it can be reloaded leading to the direct control working again, but after the save it's completely broken across the game.

I've also tried the "first element" tickbox as well as specifying the element, neither of them work after this has happened.

Hope you've all had a delightful holiday!

Comments

  • Sorry, but you're going to have to break this down more clearly.  Is this new UI canvas a replacement for the Pause menu, or a new one?  Is it linked to AC's Menu Manager, and what are its properties if so?

    If you can provide screenshots and/or steps to recreate, that would be great.

    Version numbers of Unity + AC also, please.
  • edited December 2017
    Can do! For starters, my Unity is 2017.3.0f3 (64 bit), and my AC is 1.60.7

    The new canvas created is unrelated to the pause menu, just a completely empty canvas in the _UI part of the hierarchy. Originally, I'd gotten as far as making the machinery of an inventory before noticing the direct-control no longer working, but my later tests indicated that the breaking point came upon the canvas' creation, even completely empty.

    Another thing that I note is that this only happened upon the creation of an entirely new canvas. Importing a UI from another project (a customised message pop-up) didn't affect the direct control system.

    Stage 1: UI direct-control system is working as expected. The first item in the list highlights when the menu opens.

    image

    Stage 2: New canvas created, nothing changed about its initial properties, and no linking to the AC menu system.

    image

    Stage 3: Running the game again, the first item on the menu no longer highlights, meaning the menu can no longer be controlled by direction-key input.

    image

    In addition, once the canvas is deleted from the scene, the direct control remains non-functional.
  • Thanks for the steps.

    In addition, once the canvas is deleted from the scene, the direct control remains non-functional.

    As in, deleted outside of Play mode?  I suspect that it's then related to the presence of the "EventSystem" object, which Unity will add automatically when creating a new Canvas in the scene.

    AC relies on its own EventSystem, but you want it to rely on a custom one then you can create a new prefab and assign it in the Menu Manager.  Either way, you should remove the EventSystem in the Hierarchy as AC will add its own at runtime.

    If you still have trouble, try connecting it to the Menu Manager.  A Menu doesn't need to have Elements defined, but having all UIs connected to AC should help AC's control over what's selected and what isn't.
  • Deleting the event system has indeed fixed the issue. Merci!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.