Hey Chris,
My game uses direct control for everything, so there's no mouse input (you already know this). I'm using Unity UI for the inventory, and it works fine when "Pauses game?" is enabled. However, I can't use inventory items in the game since the game is paused when the inventory is open.
When I disable "Pauses game?", the inventory starts behaving weirdly:
Clicking on inventory items freezes the inventory.
https://drive.proton.me/urls/7CY93NG28W#hOlufLTfFK3h
When using an item on a hotspot, I need to press E twice to use it.
https://drive.proton.me/urls/S0WJKCSFQC#kFhVkHxu0pPS
https://prnt.sc/B9iqSYTCQ9Vr
https://prnt.sc/ob97M0XYhZs_
https://prnt.sc/RXzulV2h3c0s
Any idea how to fix this? Preferably keeping "Pauses game?" enabled.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Another inventory issue I forgot to mention: numbers appear next to each inventory item. I've checked everything, but I still can't remove them. https://prnt.sc/xJvxKmkiwOlc
If your directly-controlled Menu runs during gameplay, you'll need to specifically allow for direct navigation using the Engine: Manage systems Action.
See the Manual's "Navigating menus directly" chapter for details.
Is the InventoryBox element's Index prefix display field set to None?
I did use Engine: Manage systems to allow for direct navigation, however I still can't use Inventory items in the game. Can you elaborate more on this please?
Just to clarify, I'm trying to use my inventory menu while the "Pauses game" option is checked. Everything seems to be working fine, except when trying to use an inventory item on a hotspot—nothing happens.
Can you share details of how Hotspots are being interacted with, starting with your Settings Manager?
My settings manager: https://prnt.sc/QFWigmBKsnXn
My interaction with hotspots is simple:
It works fine when I uncheck "Pauses game" in the inventory menu. However, once "Pauses game" is checked, nothing happens when I try to use an inventory item.
https://prnt.sc/PsfevYwjb5qr
https://prnt.sc/G_vAO2xpXhS2
Sorry, I mean to see your full Settings Manager. Are you using any custom scripts, also?
Yes, I'm using a custom script:
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof(Button))]
[RequireComponent(typeof(Image))]
[RequireComponent(typeof(RectTransform))]
public class HandleInventoryInteraction : MonoBehaviour, ISelectHandler, IDeselectHandler
{
public RectTransform _centerRectTransform; // Assign in Inspector
public RectTransform _parentTransform; // Assign in Inspector
}
And your Settings Manager?
My full settings manager:
https://prnt.sc/L17OlE5sBmzJ
https://prnt.sc/UcCyV9bRyi5g
https://prnt.sc/jhH2P46m5GVg
https://prnt.sc/IRGqk1XM02CK
You can't select a Hotspot outside of gameplay to interact with it - you'll need to come out of pause mode.
Is the pause mode requirement due to e.g. animation / sound in the scene? They could potentially be paused through scripting.
I don't mind unchecking "Pauses game", but when I exit pause mode, my inventory encounters these two issues:
Clicking on inventory items freezes the inventory.
https://drive.proton.me/urls/7CY93NG28W#hOlufLTfFK3h
When using an item on a hotspot, I need to press E twice to use it.
https://drive.proton.me/urls/S0WJKCSFQC#kFhVkHxu0pPS
Any idea how to fix these?
P.S. same things happens when I switch to AC inventory
These videos don't provide the context needed. How can I recreate these issues from a standard new game created with the New Game Wizard?
I don't think this issue will happen if you start a New Game Wizard. Is there a debug function or code I can implement to help us learn more about the issue?
Currently, the main issue is that when I press "E" on an inventory item, it gets deselected and grayed out, forcing me to close the inventory and reopen it to select the item again.
You can use the Events Editor to create an "Inventory / Deselect" event that runs an ActionList: Comment Action to put some Debug text in the Console - you can follow its stacktrace to learn why the item is becoming deselected at that time.
I’ve decided to revert back to using AC Inventory as the source for the inventory. However, it seems that AC Inventory is experiencing the same issues when "Pauses game" is unchecked. The AC inventory used to work fine before I implemented my custom inventory.
Is there a way to reset the inventory or something similar to resolve this?
You can get the default Inventory menu by temporarily switching your Menu Manager asset file (at the top of the window) to Default_MenuManager.
From there, you can then Copy the default Inventory menu, revert back to your own Menu Manager, and Paste it in.
Strangely, my AC game editor has been using the default manager for all my scenes (Scene, Menu, Actions, etc.). This means that all along, I’ve been working with the default manager.
Is it okay to continue using it?
Aside from that, whether I use the default manager or my custom game manager, the AC inventory won’t work or navigate when “Pauses game?” is unchecked.
You'll want to use your own set of Managers - created using the New Game Wizard - otherwise you'll run the risk of overwriting your game's data when upgrading AC.
The other way around this would be to ensure you omit the Default Managers from the Import dialog box when importing AC from the Package Manager.
I'll need more details on the exact behaviour? Are you trying to directly-navigate the Menu, or is the cursor intentionally active at the time?
Here's the exact behaviour:
https://prnt.sc/Jj7c2b8zw1G3
I'm happy to share the source code with you if you're interested in investigating it.