Page 1 of 1
Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 6:39 pm
by fkkcloud
Hello,
I see that the only way to disable input from DialogueManager is to disable the InputSystemUIInputModule.
But I hope to pop up a window (e.g. put your name) during the conversation.
Enabling the InputSystemUIInputModule will enable input for both since it also uses InputSystemUIInputModule.
Is this already a known issue? What is the suggested way to solve it?
Thank you
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 7:39 pm
by Tony Li
What input do you want to disable? In other words, what do you want to prevent the player from doing?
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 8:04 pm
by fkkcloud
I want to disable the play input for dialogue system only while we put up another UI that needs interaction (with general Unity UI navigation) during the conversation.
Basically, another character asks you "what is your name?"
then keyboard input UI pops up and player uses their gamepad to select key buttons to put their name. Once its done, the keyboard input UI dismisses. Then we are back on the dialogue system input.
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 8:18 pm
by Tony Li
Hi,
What do you mean by "play input"? Regular gameplay control such as moving the player character around the scene? Or interacting with the dialogue UI?
When using a gamepad, the dialogue UI tries to keep the current UI selection on itself. Before you open other UI, call:
Code: Select all
PixelCrushers.UIPanel.monitorSelection = false;
Then open your other UI. After you close your UI, call:
Code: Select all
PixelCrushers.UIPanel.monitorSelection = true;
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 8:31 pm
by fkkcloud
I meant player input by this UINavigation Move(dpad) and Submit (dualshock's X button for now)
- 화면 캡처 2020-11-18 172752.png (71.98 KiB) Viewed 726 times
Disabling the InputSystemUIInputModule - seems like the only way to disable the interaction with the Dialogue System.
I will try to tell InputSystemUIInputModule 's eventSystem's FirstSelected to be set to that Pop Up UI (not dialogue system's UI) and make change to the variable that you mentioned. Hope that works
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 8:52 pm
by Tony Li
That should work. You can also add a CanvasGroup to the Dialogue Panel and set its Interactable value to false.
Re: Input disable only for Dialogue System while on conversation
Posted: Wed Nov 18, 2020 10:13 pm
by fkkcloud
For the pop-up UI, I am instantiating and destroy it in runtime.
It is really just setting Protagonist's name with the keyboard input UI (pop up) during the conversation. then, its gone.
I guess my procedure will be
- PixelCrushers.UIPanel.monitorSelection = false;
- GameObject obj = Instantiate(Prefab_KeyboardInputUI);
- EventSystem.SetFirstSelected(obj);
- ... do the protagonist name store into Dialogue system or something
- PixelCrushers.UIPanel.monitorSelection = true;
Thank you!
Re: Input disable only for Dialogue System while on conversation
Posted: Thu Nov 19, 2020 7:53 am
by Tony Li
That looks like a good plan. The important part is to set UIPanel.monitorSelection so prevent the dialogue UI from stealing focus from your pop-up.
Re: Input disable only for Dialogue System while on conversation
Posted: Sun Nov 22, 2020 12:51 am
by fkkcloud
Everything works awesome!
I made a custom Sequencer that is called once the Type event is emitted.