Page 1 of 1

Switching action map disables interaction

Posted: Thu Feb 08, 2024 10:34 am
by blakey
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?

Re: Switching action map disables interaction

Posted: Thu Feb 08, 2024 10:58 am
by Tony Li
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.

Re: Switching action map disables interaction

Posted: Thu Feb 08, 2024 11:18 am
by blakey
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

Re: Switching action map disables interaction

Posted: Thu Feb 08, 2024 4:55 pm
by Tony Li
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:

Code: Select all

DialogueManager.displaySettings.defaultCanvas.enabled = false;
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.