Forum rules - please read before posting.

Potential Bug - Direct (Keyboard) Navigation of Conversation Menus with Unity UI

Having an odd problem, not sure if it may be a bug or not, though it seems to be...

Basically, I'm unable to get the keyboard to take over when a conversation menu appears that is built from Unity UI. I've double-checked that I've got the 'First selected element' listed in there. It's also following Constant IDs for the buttons, so it should know what it's supposed to be doing...

Two hints that may help diagnose this:

1. It seems to be a conversation menu exclusive. My regular escape-pause menu works just fine. Is it possible that this type of 'appear on' uses a 'real' pause which allows keyboard control to take over but which doesn't happen in a 'conversation' appear on?

2. It seems to be stuck in mouse mode. If I mouse-over an option, then press down on the left mouse mouse but drag away from the option before releasing it - effectively 'engaging' the menu without selecting anything, the keyboard controls then initiate, and I can then control the menu with the keyboard just as I'm supposed to.

I took the new Text Mesh Pro functionality totally out of the mix here in case that was somehow connected  - it was not. Still having same problem using regular Unity UI text in the buttons.

Hope it's just a bug and that I'm not missing something obvious...! Thinking it may also be connected to my earlier request to have a hover sound not play when a menu is initiated...?

Comments

  • edited December 2016
    Was the UI working fine before? did you double check the Navigation settings in the Unity UI elements?

    if you are in a hurry you can create a script, then slap it on the UI element to be first selected. just put the following code in it:

    using UnityEngine;
    using UnityEngine.EventSystems;
    ////next lines go inside the class

    private GameObject _element;

    void Awake()
    {
        _element = gameObject; // the element is this object
    }

    void OnEnable()
    {
        EventSystem.current.SetSelectedGameObject(_element); //make this the selected UI element
    }

  • It's unrelated to the hover sound issue, but I would recommend you keep TMPro deactivated until this is solved.

    I'd be more inclined to label this a bug with AC were you using Adventure Creator as your Menu's source, but as you're using Unity UI it may be down to that system instead (I've personally found the keyboard-controlled UI system to be quite fickle).

    Is the "First selected element" actually being selected?  If your Input method is set to Keyboard Or Controller, have you tried checking Disable mouse when keyboard-controlling Unity UI Menus? in the Menu Manager?
  • Hey there,

    Thanks for the quick fix idea, Alverik! I've got time to work this out, though... I've got the navigation settings in the elements set to 'automatic' and that seems to work for the regular menu. It's just the conversation menu specifically that isn't working...

    Chris, it definitely is being fickle. Here's a gallery of all the relevant configs, I feel like I've tried pretty much everything:


    I've even tried giving the conversation menu its own event system, so on and so forth. 

    The real weirdness is that it seems to be an issue specifically with the conversation menu. Could it have something to with the fact that the choices in a 'DialogList' element are not actually elements themselves, but rather just linked buttons? 

    As you can see in my screenshots, they've got their linked Constant IDs and all that, but it's a little different than a regular menu where each button is its own element...

    Let me know if anything strikes you as off, or if you know of anyone that has a version of this that works. Thanks!
  • edited December 2016
    Oh, and if you do think this is actually down to Unity UI jankiness that you can't really do anything about, please do let me know. I've been thinking that I can probably just roll with the AC Menu system for my pedestrian stuff (dialogue, conversations and the like) and limit my use of TMP to non-interactive but flashier menu stuff... 

    I'm loathe to mix two systems, but maybe it'll be alright...
  • That the one element is separated into multiple UI Buttons shouldn't matter, but I still need to know: is the first-selected UI element itself being correctly highlighted?

    Seems to be an issue on my end with this as well.  Lets revisit this next week.
  • Nope! First-selected is not being correctly highlighted. Nothing is being highlighted, seems like keyboard control isn't being passed to the Conversation menu at all.

    Next week would be great. Happy holidays to you and yours!
  • Thank you.  Need some time to go through this properly, but I'll write here again when I have an update proper.
  • Thanks Chris! Hope you had a great holiday.
  • Sorted - expect a fix in the next release.
  • Much appreciated, thanks!
  • Was this fixed in 1.55?
  • Yes - though an additional fix for a related issue is scheduled for v1.55c.
  • Hey Chris,

    Just letting you know that this is now fixed for me thanks to v1.55c!

    Thanks again for all your help.
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.