Quick question... when using AC menus (for conversations) the first element is selected automatically and I can cycle through the options with a controller. But I can't seem to duplicate this behavior when using a Unity UI menu (prefab). The "First selected element" doesn't seem to be working here (also tried switching over to the demo example).
Apologies if I'm missing something obvious!
Comments
UI prefabs? I see the exact same behavior as above (after adding the
EventSystem of course).
Yes, I am. The EventSystem is created automatically by AC unless you specifiy an override in the Menu Manager.
Which versions of AC and Unity are you using? It may be an issue introduced with an update to Unity.
The change itself isn't too dangerous - it'd only cause a problem if you had a Menu with no visible elements. However, the "First selected element" feature is more of an override than anything: even without setting one explicitly, Unity should still highlight one when the UI is enabled. Does this change allow you to now navigate the UI?
override the selected item regardless - so even if I tell AC to use my own EventSystem prefab that has the first-selected item filled in it gets overwritten even when no value exists in the "First selected element" value in the menu manager.
If you open up PlayerMenus.cs and find the FindFirstSelectedElement() function, you can see that the EventSystem is still called even if no appropriate element is found. A null check there may prevent that.
An all-too-common issue when using Unity, I'm afraid. But you can see from the if (element.title == firstSelectedElement) check that a regular string comparison appears to be failing. Try inserting the following line above that, so that we can get some debug info in the console:
Debug.Log ("Element: '" + element.title + "', FirstSelectedElement: '" + firstSelectedElement + "', Compares? " + (element.title == firstSelectedElement).ToString ());