Switching action map disables interaction

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
blakey
Posts: 2
Joined: Wed Dec 06, 2023 2:46 pm

Switching action map disables interaction

Post 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?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching action map disables interaction

Post 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.
blakey
Posts: 2
Joined: Wed Dec 06, 2023 2:46 pm

Re: Switching action map disables interaction

Post 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
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching action map disables interaction

Post 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.
Post Reply