Hi!
I just managed to disable the Pause function while in a conversation (and freeze the player) but how do I go about to stop a conversation from happening while in pause mode? Meaning, If I stand infront of an NPC, and I hit start to check my items, and I hit (A) in my inventory, the conversation starts running outside the StartMenu. Make sense?
Thankful for answers
Cheers!
disable conversation while Paused?
Re: disable conversation while Paused?
Hi,
Is this the scenario?
1. Conversation is active. Player character movement is temporarily frozen.
2. Player presses Start button to open StartMenu.
3. Player presses (A) button to navigate the StartMenu, such as navigating the inventory UI.
BUT the active conversation also reacts to the (A) button, either clicking the dialogue UI's continue button or a response in the response menu.
If that's the case, it could be a couple of different things. The most common reason is the dialogue UI is stealing back EventSystem focus. To prevent this, run this line of code when opening the Start menu:
and this code when closing the Start menu:
Is this the scenario?
1. Conversation is active. Player character movement is temporarily frozen.
2. Player presses Start button to open StartMenu.
3. Player presses (A) button to navigate the StartMenu, such as navigating the inventory UI.
BUT the active conversation also reacts to the (A) button, either clicking the dialogue UI's continue button or a response in the response menu.
If that's the case, it could be a couple of different things. The most common reason is the dialogue UI is stealing back EventSystem focus. To prevent this, run this line of code when opening the Start menu:
Code: Select all
PixelCrushers.UIPanel.monitorSelection = false;
Code: Select all
PixelCrushers.UIPanel.monitorSelection = true;
Re: disable conversation while Paused?
Yes, thats the scenario... I can start conversations while In my StartMenu and navigating.Tony Li wrote: ↑Mon Apr 12, 2021 3:14 pm Hi,
Is this the scenario?
1. Conversation is active. Player character movement is temporarily frozen.
2. Player presses Start button to open StartMenu.
3. Player presses (A) button to navigate the StartMenu, such as navigating the inventory UI.
BUT the active conversation also reacts to the (A) button, either clicking the dialogue UI's continue button or a response in the response menu.
If that's the case, it could be a couple of different things. The most common reason is the dialogue UI is stealing back EventSystem focus. To prevent this, run this line of code when opening the Start menu:and this code when closing the Start menu:Code: Select all
PixelCrushers.UIPanel.monitorSelection = false;
Code: Select all
PixelCrushers.UIPanel.monitorSelection = true;
I tried the code like this but it didn't work:
Code: Select all
using PixelCrushers.DialogueSystem; // Add to top of your script.
void update()
{
if (_gm.GameIsPaused)
{
PixelCrushers.UIPanel.monitorSelection = false;
}
else
{
PixelCrushers.UIPanel.monitorSelection = true;
}
}
This is how I managed to turn of my Pause function WHILE THE CONVERSATION is already active:
Code: Select all
if (DialogueManager.isConversationActive)
{
Debug.Log("coversationActive");
playerChatting = true;
}
else
{
playerChatting = false; //In gameManager I say - If platerChatting = true -> CanPause = false;
}
Re: disable conversation while Paused?
How are you starting conversations?
For example, does your player have a Proximity Selector and your NPC has Usable and Dialogue System Trigger components?
If so, when you open your StartMenu, disable the player's Proximity Selector. When you close the StartMenu, re-enable Proximity Selector.
For example, does your player have a Proximity Selector and your NPC has Usable and Dialogue System Trigger components?
If so, when you open your StartMenu, disable the player's Proximity Selector. When you close the StartMenu, re-enable Proximity Selector.
Re: disable conversation while Paused?
That sounds like it should work. Yes, im using Proximity Selctor on my Player. But how do I access that script?Tony Li wrote: ↑Tue Apr 13, 2021 9:14 am How are you starting conversations?
For example, does your player have a Proximity Selector and your NPC has Usable and Dialogue System Trigger components?
If so, when you open your StartMenu, disable the player's Proximity Selector. When you close the StartMenu, re-enable Proximity Selector.
If I put the Proximity Selector on a child object of the Player, it won't launch any conversation at all.
(I was thinking I could turn off the GameObject with the Proximity Selector attached on it while Pause is true.)
And If I keep the Proximity Selector on the player I can't reach the script by writing:
Code: Select all
pulibc ProximitySelector _proxy; (its underlined in Red)
EDIT i made it work by adding pixelcrusher to the top of the Playerscipt! My bad!
Re: disable conversation while Paused?
Glad you got it working!