Forum rules - please read before posting.

Non mouse based cursor question

Hey,
I have a few question about AC cursor. 
1) If AC cursor is not controlled by mouse, will it be able to interact with Unity UI elements? I tried temporarily setting movement to direct and controlling cursor with CursorHorizontal/Vertical values, but it didn't respond to UI elements.

2) If yes, whats the easiest way to enable non-mouse based cursor movement if I have to have input mode set to Point and Click ? manually overriding AC.KickStarter.playerInput.InputMousePositionDelegate ?


Not related to this, but is there a way to cycle through selected inventory items with button or axis while interaction mode is set to Context Sensitive and input mode set to Point and Click ?





Comments

  • When using Unity UI, what is selected/interacted with is down to your Event System.  By default, the Event System allows for either the system cursor, or direct navigation via the Horizontal/Vertical axes.

    If you need to implement a custom way of navigating a Unity UI, you'll have to create a custom Event System.  That's separate to AC, as you're just dealing with Unity - but once created, you can assign a custom Event System prefab in the Menu Manager to override the default.

    If you're looking to directly-navigate UI menus through e.g. keyboard input, Unity UI requires that an element be selected already before another one can be navigated to.  AC automates this via the Auto-select first visible Element? and First selected Element? fields at the base of a Menu's properties.

    To cycle through a list of items in a Unity UI-based Menu: If you're looking for something with more control than the Unity-provided direct navigation (Standalone Input Module), then you can write a custom script that sets the EventSystem's selected GameObject according to input.  Again, though, that's separate from AC - since you're just looking to control a Unity UI Button selection.
  • edited November 2018
    Thanks!

    About Inventory, I meant something different. Let's say I selected item in inventory, and it's now set as "Selected Item" that I can use with hotspots:


    So, now let's say if I used mousewheel the "Selected Item" would change, and scroll through my inventory items. So it would go Sword->Coins->... -> Back to Sword. So what item is currently selected would change.

    I thought I remembered seeing some option for this, but could not find it now. I guess I can get player inventory and scroll through it manually, but I just wanted to confirm if there was built in solution, before implementing my own.


  • Thanks for the clarification.

    If you're using "Choose Hotspot Then Interaction" mode, then the "Cycling Cursor And Clicking Hotspot" does allow for this, since you can cycle through inventory cursors as well - but it's bundled with the available "use" Interactions as well.

    In the case of "Context Sensitive", you'll have to implement your own.  It's simple to retrieve the active Hotspot's list of available inventory interactions, however:

    Hotspot activeHotspot = KickStarter.playerInteraction.GetActiveHotspot();
    List<Button> invButtons = activeHotspot.invButtons;
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.