Forum rules - please read before posting.

Show cursor only when inventory is open

edited February 2016 in Technical Q&A
Hi everyone, i've managed to open/close inventory using a specified key button, but due to the kind of game my cursor is set to "show only when pause is pressed", how can i show cursor even when inventory pop? Or alternatively select a item from inventory pressing left/right arrow from keyboard or gamepad.
Thanks in advice :D
«1

Comments

  • If you want the cursor to only show when paused, then make the inventory menu pause the game when it opens.  Check Pause game when enabled? in the Inventory Menu's properties.
  • Thank you Chris it worked!
    Any chance to select inventory items using arrows from keyboard and/or pad?
  • If your game's Input method is set to Keyboard Or Controller, then you'll be able to navigate with the Horizontal and Vertical axes.  Otherwise, if you switch your Inventory menus' source to Unity UI then you can make use of Unity's EventSystem to navigate it however you want.
  • Perfect, many thanks again
  • Hmm... Not working for me I'm afraid, neither controller or keyboard. Pause when enabled is checked, and my Input method is Keyboard or controller, with keys and button inputs assigned.

    If I double click the mouse, the cursor "comes alive" and I can use that, but, of course, I want to be able to use controller / keyboard.

  • Are you using Unity UI or AC as your menu's Source?  Try navigating the default Pause menu - does that work?
  • I'm using Unity UI. Pause menu also doesn't work with keyboard/ controller, but it does with mouse.
  • Check that the Menu has a "First selected element" defined in it's properties.  This should already be the case of default UIs, though.  This should be the name of the element as listed in the Menu Manager - not the Gameobject.
  • Alrighty, that was it; no First selected element in the menu for resume, options etc. So it works for the Pause menu. It's still not working for inventory though, I tried putting Linked Button (1) for First selected Element but it just won't play ball.

  • Again, you have to enter the name of the elment as listed in the Menu Manager (e.g. "InventoryBox"), not the name of the Unity GameObject itself.
  • Right, thank you - sorry for making you repeat yourself there. I can now use the inventory and pause settings with the controller. However, the cursor is still there, even though it is not visible. I tried to put the appear type to never, but it still interacts with menu elements.

    To get around this, I thought of just using the cursor for menus, so  I have the cursor set to appear on Pause (using default texture), yet, it doesn't appear. You can tell it is there because if I pause the game, one of the menu options is constantly highlighted, but it still allows me to highlight other menu buttons using the controller.

    Is there a way to completely disable the cursor if using keyboard and controller as a control method?

    I hope this makes sense.

  • You can disable any of AC's systems, including the cursor, with the Engine: Manage systems Action.
  • Would I need to use this as an on-start action for every time the player enters every scene in the game, then?

    It's not a big problem, but I'd like to make a small feature request for a future AC version:                The option of having a disabled cursor for direct-control, keyboard/controller based games throughout. Then of course, we can use the manage systems action to enable the cursor when we need it, rather than having to keep disabling it.

    Thanks again, Chris.

  • At the top of the Settings Manager, you can assign an ActionList asset file that runs when the game begins (think of it as a "global" OnStart).
  • There's a field for cutscene settings: ActionList on start game, where you can place an Action List Asset.

    Or do you mean literally at the very top, in the settings manager field? All I have in the Action list is just Engine: Manage Systems - disable cursor.

  • ActionList on start game - that's the one.
  • The problem persists I'm afraid. Not exclusive to Unity editor either, the cursor is still there in builds. Are you not able to reproduce this on your end?
  • No, I'm not.  Make sure your Cursor rendering setting in the Cursor Manager is set to Software - this way the constant draw calls needed to make it appear won't be called.

    Try it with the 3D Demo's Managers loaded and run the Action manually from a Cutscene (click "Run" in the Inspector) to see what effect it should have.  If it still doesn't work, it may be a platform issue.  I've found that the cursor behaves differently in Unity when working on Mac vs PC - though generally only in the Editor.
  • Ok, I've put two videos together (don't worry, they're very short):

    https://www.youtube.com/watch?v=tJQ02H_cZEw

    This first one shows a totally empty, brand spanking new project, with only Adventure Creator imported. Using the 3d Basement demo, I've set the movement to direct, and controls to keyboard / controller. The cursor is set to enable on Pause only, but as you can see in the video, the cursor doesn't appear when I enter the Pause menu. Also, at the start of the video, you can see that the cursor is still there (though invisible), and can highlight the menu button in the corner of the screen.

    https://www.youtube.com/watch?v=RmEQq8nIiSU

    This second video is of my game, and you can see when I enter the Pause menu, the cursor is not visible, but is still highlighting the buttons in the menu, as well as the keyboard/controller. I have tried cursor with appear type on both, pause only and never - same result.

    Both videos are of builds, rather than in editor, and use Software cursor rendering.

    I am on Unity 5.3.2f1, Adventure creator 1.50i. Windows 10.



  • edited March 2016
    Thank you for your concern ;)

    The first scenario is intended - much like your request to disable the cursor for all keyboard games, the cursor will not show if the game is paused and Menus are controlled by keyboard / controller.

    With the second: how are you sure that it is the mouse that is highlighting the Resume button?  Is it because you can move the mouse to select multiple?  As you are controlling the Menus through Unity UI, it may be that you just need to tweak (or assign in the Menu Manager, then tweak) your EventSystem so that it doesn't react to the mouse.

    Also, try setting your Cursor rendering to Hardware (though it's unlikely that will make a difference).
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.