Switching action map disables interaction
Switching action map disables interaction
Hey, so I'm using the dialogue system with Unity's new input system, and this works fine when playing normally. When I pause the game during dialogue, the current conversation is stopped in code and starts the same conversation at the line it stopped at when I resume the game. I do this so I can hide the conversation UI when the pause menu UI is showing.
I also switch the current action map to a UI action map and back to the player action map when i resume the game, but upon doing this I can no longer interact with the dialogue Continue button. I can move around in the game as normal so I know it switched back correctly.
Any ideas?
I also switch the current action map to a UI action map and back to the player action map when i resume the game, but upon doing this I can no longer interact with the dialogue Continue button. I can move around in the game as normal so I know it switched back correctly.
Any ideas?
Re: Switching action map disables interaction
Hi,
Please see the tips in How To: Pause Dialogue In Pause Menu.
Also, a better way to hide the dialogue UI would be to disable its Canvas component. This keeps everything intact and should resolve the continue button issue. But make sure you review the tips in the link above so the continue button doesn't try to steal UI selection focus while it's hidden.
Please see the tips in How To: Pause Dialogue In Pause Menu.
Also, a better way to hide the dialogue UI would be to disable its Canvas component. This keeps everything intact and should resolve the continue button issue. But make sure you review the tips in the link above so the continue button doesn't try to steal UI selection focus while it's hidden.
Re: Switching action map disables interaction
Hey, thanks for the response. I swapped in that code from the link you sent me and that works fine, but is there a specific syntax for disabling the canvas?
Also the issue of switching the action maps from player, to ui, and then back to player stopping input to the continue button still persists regardless. Do you have any idea on a fix for this?
Thank you
Also the issue of switching the action maps from player, to ui, and then back to player stopping input to the continue button still persists regardless. Do you have any idea on a fix for this?
Thank you
Re: Switching action map disables interaction
Hi,
If your dialogue UI is in the Dialogue Manager's default canvas (assigned to the Dialogue Manager's Display Settings > Default Canvas), you can use:
If you're not able to click the continue button using keyboard or joystick, but you can click it using the mouse, then inspect the Dialogue Manager GameObject. Tick in the Input Device Manager component's Always Auto Focus checkbox.
If your dialogue UI is in the Dialogue Manager's default canvas (assigned to the Dialogue Manager's Display Settings > Default Canvas), you can use:
Code: Select all
DialogueManager.displaySettings.defaultCanvas.enabled = false;
Re: Switching action map disables interaction
Hi.
Has anyone found a solution?
I have the same problem. I can't solve it in any way.
Has anyone found a solution?
Re: Switching action map disables interaction
Hi,
There isn't a single solution. It's more of an Input System thing than a Dialogue System thing.
If you're using a UI Button Key Trigger component on your continue button, make sure you're not disabling the input action assigned to it.
If you're using whatever input action is assigned to your EventSystem GameObject's Submit dropdown, make sure that action and its map are active.
There isn't a single solution. It's more of an Input System thing than a Dialogue System thing.
If you're using a UI Button Key Trigger component on your continue button, make sure you're not disabling the input action assigned to it.
If you're using whatever input action is assigned to your EventSystem GameObject's Submit dropdown, make sure that action and its map are active.
Re: Switching action map disables interaction
I will describe the situation in more detail.
I'm using EventSystem UI InputModul with my custom Actions Asset.
В скрипте меняю ActionMap when any ui menu turns on or off.
If SwitchCurrentActionMap is never called, the buttons and mouse cursor work fine in the dialog system throughout the game.
If you turn on the ui menu and call SwitchCurrentActionMap at least once. The UI in the dialog system stops responding to any form of input. Even if no dialogue has been launched before.
I also noticed that if I use the Default Actions Asset, the menu in the dialogs works fine.
I'm using EventSystem UI InputModul with my custom Actions Asset.
В скрипте меняю ActionMap when any ui menu turns on or off.
private IEnumerator SwitchInputAction(GameObject gameObject)
{
yield return new WaitForSecondsRealtime(0.1f);
if (gameObject)
{
PlayerInputWrapper.PlayerInput.SwitchCurrentActionMap("UI");
}
else
{
PlayerInputWrapper.PlayerInput.SwitchCurrentActionMap("Player");
}
PlayerInputWrapper.PlayerInput.ActivateInput();
}
If SwitchCurrentActionMap is never called, the buttons and mouse cursor work fine in the dialog system throughout the game.
If you turn on the ui menu and call SwitchCurrentActionMap at least once. The UI in the dialog system stops responding to any form of input. Even if no dialogue has been launched before.
I also noticed that if I use the Default Actions Asset, the menu in the dialogs works fine.
Re: Switching action map disables interaction
Hi,
Which dialogue UI input is not working? If it's selecting and clicking continue buttons and response menus, then that solely uses the EventSystem. Any UI that uses Unity UI should have the same issue. In this case, there's nothing that the Dialogue System can do since it all depends on the EventSystem.
Is your click input action set to Release Only instead of Press Only?
Which dialogue UI input is not working? If it's selecting and clicking continue buttons and response menus, then that solely uses the EventSystem. Any UI that uses Unity UI should have the same issue. In this case, there's nothing that the Dialogue System can do since it all depends on the EventSystem.
Is your click input action set to Release Only instead of Press Only?
Re: Switching action map disables interaction
I found out exactly what stops working if you use PlayerInputWrapper.PlayerInput.SwitchCurrentActionMap("UI");
Last edited by DenisOwl on Fri Feb 28, 2025 6:06 pm, edited 1 time in total.
Re: Switching action map disables interaction
Hi,
I don't follow exactly what's happening under the hood in the view. (Your game looks really cool, though!)
Are you using a script with InputDeviceManager.RegisterInputAction()?
Can you send a reproduction project to tony (at) pixelcrushers.com?
I don't follow exactly what's happening under the hood in the view. (Your game looks really cool, though!)
Are you using a script with InputDeviceManager.RegisterInputAction()?
Can you send a reproduction project to tony (at) pixelcrushers.com?