Hi.
I have a couple of questions regarding some issues I've encountered.
I've added a video where I show the issue. When I open the inventory menu and the mouse cursor is positioned just right, it highlights whatever item or objective is present in that vicinity. Normally, on Mouse and Keyboard controls, that wouldn't be an issue, but it seems to cause confusion with players when using a controller. It also causes double selection. The auto-select first element combined with the cursor selection makes navigating the menus clunky and unintuitive. Is there a way to move the cursor to a specific point where it no longer affects any items?
My second question relates to Direct Control as well. I've tried setting "When slot is empty" to both "Clear content" and "Disable object," but I'm experiencing an issue where direct control selects the disabled slots without any visual feedback. This again causes confusion. I've added an empty slot texture to try to counteract this, but that seems to cause a different problem with my custom filters. Fortunately, it's only a visual issue, but I can still see people being confused or annoyed by it.
As always, I appreciate any and all help. Thank you in advance.
https://drive.google.com/file/d/1C8r3GZ8y-nNMACsUgYrQ0Y_2LuHVmIfY/view?usp=sharing
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
What is your Input Handling, does the Menu use Unity UI, and what components are on your Event System if so?
Repositioning the cursor is actually quite tricky. AC's Optional Mouse Input Module can get around this double-selection issue because it can divert input to either the controller/keyboard, or the mouse, but it's not compatible with Unity's Input System.
If you're using Input System, it may need to be a case of e.g. temporarily disabling the "Point" input action while the Menu is open.
If this is present, try selecting the Event System in Play Mode before opening the Menu, and clear the "Point" field from the Input System UI Input Module. Does doing so then prevent the cursor from selecting the UI when you then turn on the Menu?
When and how exactly does this occur?
A quirk of Unity's UI Navigation is that if your Button's Navigation is set to Explicit, it will attempt to select objects even if they are inactive. Might this be the case here?
Hi Chris, thanks for replying so quickly. Yes, I'm using Unity UI, and it's a choice I've been regreting ever since. I've taken a look, I do use Explicit in some places but not on the inventory. I've checked the grid for all inventory boxes and they're all on automatic. Let me see if I can get any results with disabling "Point" input action Thank you.
https://drive.google.com/file/d/1en9MW1HCE_B9lTsYPAsefiE0GQlbKp9S/view?usp=sharing <- a screenshot of my Event System. I don't think it's "Point" input action that's the problem.
No indeed - you're using Input Manager for input handling, which means the Optional Mouse Input Module is running, which gives us more flexibility.
This might take a few steps, but let's first try locking the cursor before turning the Menu on. You can do this with the Player: Constrain Action.
For the moment, this will lock the cursor in the centre of the screen. For now, try opening the Menu when the cursor is off to the side (but still over where one of the Item slots will appear). Which item slot then becomes selected - the one the cursor was initially over, or the one in the centre of the screen?
I've added Player - Contrain - Cursor Lock - Enable in the "When Turn on" Actionlist of the menu. Is that sufficient or should I add it even before that - for example in the input actionlist that triggers the menu. With the Cursor Lock in the When Turn On Action List, the Inventory Box selection is made by the cursor that's moved to the sides.
Sorry - is that to say it's selected by the original, or the new position?
If the original, yes - we'll need to try to get this to react to the new position.
https://drive.google.com/file/d/1IhpTK9andlUAtpdZ59d_nJvSly0-loyd/view?usp=sharing here's a video. The system cursor is fine, don't seem to casue issues, the game cursor is the issue.
To be clear: you have both the Menu Manager's Directly navigate when paused? and Menu's Pauses game? options checked?
Yes, try moving the cursor lock command earlier - but also, try running a Menu: Select Action at the end of When Turn On to force the selection of the first Item slot.
https://drive.google.com/file/d/1gUel6nNROHQq9ZJSDq_-7txZheSGacxd/view?usp=sharing <- here's an image with the setup and here's a video https://drive.google.com/file/d/1ZtU1phg_rNThhG2jLpv7hd_V7eTHLeHX/view?usp=sharing. The issue persists. I don't know if it's because of the Menu selection or the cursor. I've tried removing the Select Element from the secondary menu and adding it to the chcaracter tab. The double selection still occurs. It selects a different element from the menu, but the cursor still highlights the inventory box item. I think the cursor deselect needs to be placed even earlier somehow, but I'm not sure how or where. It's already running before the menu opens.
Is Directly navigate when paused? checked, and is the cusor controlled by the mouse, or the controller?
If the above is checked, you shouldn't need to lock the cursor as it should hide automatically when the game pauses.
I attempted a test of my own that involved hovering the cursor over a UI pause menu that then turns on, and it didn't interfere with selection. The issue may be due to your changing settings - which of these are you modifying at the same time as the Menu opens?
https://drive.google.com/file/d/1R5vgYm1N_ujJWmtq_XS423QFYTtSwisw/view?usp=sharing <- here's a video of how I set it up. The Mouse cursor is controlled by both Mouse and Controller.
Input setup: https://drive.google.com/file/d/1DK33O_9UYosYTMrZJRDmM-59xALEepfF/view?usp=sharing
https://drive.google.com/file/d/1DK33O_9UYosYTMrZJRDmM-59xALEepfF/view?usp=sharing - The script used to monitor the change
Settings changing occurs only when you manually change the variable in the script.
The 2nd and 3rd links are the same - can you share the script again?
Does the variable change value outside of the Options menu?
It would be worth using the New Game Wizard to create a new AC game within the same project (back up first), and then copy over the Menu(s) involved into your new Menu Manager, and set up the Settings Manager to the Controller values. A fresh scene can then be used to isolate the issue from the rest of the game - does the issue persist there as well?
Sorry for the double link. Must have not registred my copy-paste. Here's the script.
using UnityEngine;
using AC;
public class InputMethodMonitor : MonoBehaviour
{
private static InputMethodMonitor instance;
}
Keep the settings fixed for isDirect and don't change them with the script - does it then behave?
The video I've shared initially has the settings fixed. This sript is enabled only if you start from the Ttitle Screen so it shouldn't affect anything. Probably a dumb question but I've noticed that there's an "Input - Simulate: Input Axis". That can't be used to simply move the cursor out of the way to a specific position?
The cursor can be moved through script, but so far our attempts to move it to the centre still results in the previous position being the one that is used for selection. If we can "catch" it and lock the cursor before this occurs, then we can see about adjusting the locked position.
Though, this ought not to be necessary in the first place as the Event System should handle the removal of the cursor from UI selection if the Menu is to be directly navigated. My own test doesn't have this issue, but so far I'm not sure which aspect of your own project is causing it.
The Event System you shared is the one being used in the scene at runtime, I take it - there's no override in the scene file itself?
https://drive.google.com/file/d/1QNUOQYb2SMdRVbRM_J9PryVZuu_pYVRz/view?usp=sharing <- Here's the event system when changing scenes. As far as I can tell nothing is changing. I started from Splashscreen - Title Screen - Cinematic - Fist Scene.
Try my earlier suggestion of using the New Game Wizard to isolate the Menu in a separate game. I can't yet see what, but I suspect there is some other factor in your project that's causing this unwanted behaviour.