Hi Chris,
We’ve run into an issue where selected inventory items get automatically deselected when the game loses focus specifically while player control is blocked (e.g. during a dialogue).
Restarting the game or switching to a different scene restores normal item selection behavior.
Here’s a video showing the behavior
Unity version: 6000.0.49f1
Adventure Creator version: 1.83.0
Thanks again for your support!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
What platform are you working on? To be clear: this is about selecting new items after switching focus, rather than items becoming deselected at the time you switch?
What are you using for input, and what is your project's "Active Input Handling" set to?
If you create an Inventory / Deselect event in the Events Editor, and have it run an ActionList: Comment Action, you can print some debug text in the Console when items become deselected. What does it say - in full - when the issue occurs?
Thanks for your quick reply!
I’ve now created an Inventory / Deselect event in the Events Editor, with an ActionList: Comment that logs a debug message.
When the issue happens, I see the comment appear immediately after trying to select an inventory item once the focus has returned.
So something is clearly triggering a deselect right after selection in that context.
Let me know if there’s anything else I can try or check!
I’ve found consistent repro steps that always trigger the issue:
Here’s a video showing the issue
Let me know if you need more info!
I cannot reproduce such behaviour.
Are you using Input System to read mouse input, along with AC's integration for it?
What is the message in full, stacktrace included?
Here is full stacktrace
Hard to tell, I think everything is default.
The item in this case - given the stacktrace - is becoming deselected because of an Inventory: Select Action with a Select type of Deselect Active being run.
You can use the Actions Manager to print a list of instances of this Action in the Console.
Hey Chris,
Huge thanks – you basically saved our lives with this one! 🙌 Your hint led us straight to the issue.
It turned out that the problem was caused by an Inventory: Select action with the Deselect. This was part of an ActionList that was triggered when the pause menu opened. However, we expected it to run only when the menu is turned on via the Menu Manager (ActionList when turn on: for the Pause menu).
But here’s the confusing part: it kept firing even after we had already closed the menu. Do you know why this might be happening? Does the ActionList somehow keep running after the menu has been turned off?
Here is a screenshot of the ActionList for context.
Thanks again – really appreciate your help!
What are the ActionList's properties, and how is it set to run? In the Menu's ActionList when turn on field?
Yes, exactly — the ActionList is assigned in the menu’s “ActionList when turn on” field for the Pause menu.
And when/how is the Pause menu turned on?
The Pause menu is turned on by a button in the Inventory, using the Crossfade menu command in Menu Manager.
Try the same method as in the other thread, i.e. swapping out the Managers (fully and then partially) for that of the Demo game.
In Demo_MenuManager, you can alter the Inventory menu's ShiftLeft button to crossfade to the Pause menu to have it behave similar to your own game.