I am using Unity 6 with Adventure Creator 1.82. My project uses the Direct Movement system.
Opening the inventory pauses the game setting is unchecked.
With this setting, I cannot navigate the inventory with keyboard or gamepad keys. I cannot select inventory items or combine them.
When opening the inventory is set to pause the game, the inventory items seem to be hoverable but I still cannot select them. And also setting the game to pause when the inventory is opened seems to break the pace of the game. So I do not want the game to be paused.
How can I navigate and use the inventory on the Direct Movement system?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
To enable the direct-navigation of Menus during gameplay, use the Engine: Manage systems Action.
If you use Unity UI for your Menus, you'll also need to configure which element gets selected by default in the Menu's properties.
The Manual's "Navigating menus directly" chapter has details on this topic.
All set using the Engine: Manage systems action.
But it made a small bug: If I hit the inventory key while also pressing the key to move the player character to any direction, when the inventory opens, the player character continues to move until the inventory is closed again.
My action's screenshot (When the inventory is turned on):
https://imgur.com/a/RB87WyJ
Use the Character: Move along path Action's "Stop Moving" command to force-stop the Player just after this Action.
That fixed it, thanks.
Now I tried with a gamepad, and when the gamepad disconnects, the player continues to move toward the last pressed direction. Even when restarting the game in the editor. As long as the gamepad is disconnected. Even the Character: Move along path Action's "Stop Moving" command does not fix this.
Is this a Unity thing or is it on Adventure Creator?
It's not a behaviour I can recreate, but I'd guess this would be on the Unity side of things. AC is reading for input in the standard way that Unity provides, so it'd be down to what input values are being given to it.
What's your Unity version, and are you using Input System or Input Manager?
I am using Unity 6 (6000.0.27f1).
I am using the Input Manager while the active input handling setting in Project Settings is "Both" selected. However, I tried setting it to Input Manager, but the issue persisted.
I tried the same thing on a widely-known Unity game on my system, and the issue didn't occur on it.
I wrote a script so that when the gamepad is disconnected, the Pause menu opens. When the Pause menu opens that way, the menu buttons are not navigatable; only the Interaction A input works to Resume (As it is the initially selected button) the game. But when the game is resumed with the gamepad disconnected, the player character continues to move to the last pressed direction.
For example if at the time the gamepad is disconnected, the move-up stick is being pushed, after disconnection, if I press the down arrow on my keyboard the player character moves down but when I release my hand from the keyboard's down arrow, the player starts to move up again.
Locate your GameEngine object in the scene, and the Player Input component within it. Set the Direct Movement Responsiveness to zero and test again.
Next, open up the PlayerInput script, and find the CreateMoveKeys function (around line 1342 in the latest release). At the top, copy/paste:
That will print out the input values used to control the Player each frame in the Console. What does it display at the time the Player is moving with no input from the keyboard or the gamepad?
"Locate your GameEngine object in the scene, and the Player Input component within it. Set the Direct Movement Responsiveness to zero and test again."
I tested with Direct Movement Responsiveness = 0, and the issue persisted.
Then I pasted the debug line into the PlayerInput script.
After I disconnected the gamepad (while pushing the joystick upwards), while the character was still moving upwards, the console print was "Raw V: 1".
https://imgur.com/a/5xiHxnA
As a side note, when I disconnect (turn off) my keyboard (not the gamepad) while moving, the player character stops.
Does this occur if you temporarily remove the non-gamepad Vertical inputs from your Input Manager? You can rename them to e.g. "Vertical_Unused" to prevent deleting them.
In the Debug.Log statement, replace "InputGetAxisRaw" with "Input.GetAxisRaw" - what does it then display?
"Does this occur if you temporarily remove the non-gamepad Vertical inputs from your Input Manager? You can rename them to e.g. "Vertical_Unused" to prevent deleting them."
Yes, it still happens when the keyboard inputs don't work.
"In the Debug.Log statement, replace "InputGetAxisRaw" with "Input.GetAxisRaw" - what does it then display?"
Like this:
https://imgur.com/a/lNoNs3y
By the way, here is how my gamepad vertical input field looks like:
https://imgur.com/a/7TbO4HX
If Input.GetAxisRaw is returning 1 with no other input device, then the issue is on the Unity side. You may have better results with Input System, though you'll need AC's integration package on the Downloads page to use it.
I have switched to the Input System and the issue is solved. Now the player character does not continue moving when the gamepad is disconnected.
However, now that the Input System is in place, the gamepad's D-pad buttons do not work on the menus; only the left stick does.
Here are my screenshots:
https://imgur.com/a/YsrrC9z
Update: I made the d-pad work for the UI by adding input mapping to the player movement by d-pad instead of UI.