Forum rules - please read before posting.

Using Unity Ui for Interaction Menu

I'm having an issue with button-highlights when using Unity Ui for the interaction menu (prefab). The behavior is the same when using your demo example.

Basically, the first element does seem to be selected (so I can access with a keyboard/gamepad) but the highlight state doesn't show at all.

Interestingly, if I ADD a new button (not interaction) to the end of the menu and then link an element in the Ui prefab to that and set it as the first selected element, that WILL get highlighted. Plus, I can then navigate and see the highlights on the other interaction elements. When removed, it does not work.

Any ideas?

Comments

  • To be highlighted, the element's name must be written into the First selected element box - have you done this for the Interaction, and is that specific Interaction available when the Menu shows?  You need to add it when switching to Keyboard input, because if it's there when using a mouse then two elements get highlighted.
  • Yes, and I've done this setup a bunch of times now and converted almost all my menus to Unity Ui.

    As I said, the interaction elements ARE actually selected and selectable (I can use the keyboard to choose one)... but the highlight states don't show unless I add a dummy button element (that is not assigned as an interaction element) and set THAT as the "First selected element." When I do that I can get all the highlights to show by keyboarding-around. But without the lone button element in the menu it just won't work regardless of what I do (I've used your managers, I've recreated from scratch, etc). Note that I don't have inventory interactions and am working with the very latest AC. 

    Help!! :)

    But you also bring up another point - what if your first selected element interaction is not available? 
  • I will try to recreate this myself, but it could be an issue with Unity given the nature of the problem.  What version of Unity are you using?
  • "First selected" also doesn't work for me when I use unity UI. So, I force it by calling a function with:

    EventSystem.current.SetSelectedGameObject(MyButton);

    I just call it with Object: Send Message and it works just fine that way.
  • Thanks, Chris... using 5.3.4p5 (and also have a version in 5.4b18). LMK if I'm crazy!

    @Alverik... I haven't had to do that with other button-based menus. It took me way too long to realize that AC wanted the element-name text in the "first selected", but once I blew past that stupidity and it seemed to work. 
  • What, do you mean it's asking for the Unity UI element name? not the AC button element name? Cause, I've been putting AC element's names in the "First selected" area provided by the AC Menu manager and nothing happens. Guess I'll try using the Unity UI element's name instead and see if there's any difference.
  • Hmm... sounds like you were doing it correctly. I believe I had to disable the cursor as well.
  • edited May 2016
    Yeah, I think my issue may stem from the fact that I use a Rewired event system with the Dialogue system. Maybe the combo doesn't play well with AC's selection of the First Selected?

    The rewired event system is permanently attached to the UI canvas attached to The Dialogue System manager. Before, I had the Rewired event system as the default one to be created by AC, but I had to change that, because the Dialogue System creates an event system itself if it doesn't find one first, and for some reason, it runs before AC has the time to spawn the default event system (which screws the scene because then there's no inputs).

    Anyway, I can't think of any other reason why the First Selected doesn't work right for me... If I remember well, I think I already disabled the cursor too...
  • It's a tricky area to be sure. I was actually planning on moving to Rewired a bit down the line (already using Opsive's Third Person Controller). But am preparing for the integration hurt.

    This Unity UI stuff is one of the only areas of AC that's tripped me up more that once.
  • edited May 2016
    Yeah, true. Up till now, UI in general has always been a torn in my side... I'm currently struggling with using Unity UI for the inventory boxes. I'm trying to do a JRPG style inventory, which has several tabs, one for each type of item, and I'm currently stumped about how to get it to work... AC somehow shows nothing if even one of the inventory boxes, in the inventory menu, is set as not "visible", so I have no clue how I'm gonna do the navigation, seeing how all the inventory boxes are supposed to be stacked (they all even share the same slots too, so I can't really try to use the technique of disabling or enabling objects)...

    PS: By the way, how well does the Opsive's Third Person Controller perform with AC?
  • Like all the integrations - it takes a bit more work than it would initially appear to get things solid. But overall it is a really well-put-together asset, and the dev is very responsive.
  • The issue reported in the first post of this thread should be fixed in the next release.
  • Thank you, Chris.
  • Hi Chris - any ETA on this fix?
  • AC v1.52 is out.
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.