Main Menu & Quest Machine
Main Menu & Quest Machine
Hey Tony!
I have a doubt regarding the Main Menu and Quest Machine. I built another scene for my main menu and at the same time, I create an Option button in the game which contains Quest Machine and Dialogue System.
Everything works fine except when I press on the Option button to return back to main menu. The Option panel that I created do not disappear, as well as all the buttons & HUD text in the game.
The steps that I have tried to solve this issue:
1. Set inactive to all the buttons. But I found out that when I click Play to restart the game, the game is actually in paused mode (not end).
2. Set the Time.timeScale to 1 in my main menu scene. However, it didn't help to fix it.
3. Create another canvas and put all the buttons into it. This deactivates all the buttons and could not be clicked at all.
4. Create another scene for Pause Menu - same problems are still there and Resume button become Restart.
Also, if I manage to resume the game, there's no response after clicking on the buttons.
Is this actually related to any option in Quest Machine or Dialogue System? Hope you can provide me some advice/suggestions to resolve it. Have been solving it for few weeks.
I have a doubt regarding the Main Menu and Quest Machine. I built another scene for my main menu and at the same time, I create an Option button in the game which contains Quest Machine and Dialogue System.
Everything works fine except when I press on the Option button to return back to main menu. The Option panel that I created do not disappear, as well as all the buttons & HUD text in the game.
The steps that I have tried to solve this issue:
1. Set inactive to all the buttons. But I found out that when I click Play to restart the game, the game is actually in paused mode (not end).
2. Set the Time.timeScale to 1 in my main menu scene. However, it didn't help to fix it.
3. Create another canvas and put all the buttons into it. This deactivates all the buttons and could not be clicked at all.
4. Create another scene for Pause Menu - same problems are still there and Resume button become Restart.
Also, if I manage to resume the game, there's no response after clicking on the buttons.
Is this actually related to any option in Quest Machine or Dialogue System? Hope you can provide me some advice/suggestions to resolve it. Have been solving it for few weeks.
Re: Main Menu & Quest Machine
Hi,
The Quest Machine GameObject and the Dialogue Manager GameObject both survive scene changes. Can you put them on their own GameObjects instead of Options?
The Quest Machine GameObject and the Dialogue Manager GameObject both survive scene changes. Can you put them on their own GameObjects instead of Options?
Re: Main Menu & Quest Machine
Sorry, I don't get what you meant.
Re: Main Menu & Quest Machine
Maybe I misunderstood.
Do you want to hide the Dialogue System and Quest Machine UIs when you return to the title menu scene?
If so:
Do you want to hide the Dialogue System and Quest Machine UIs when you return to the title menu scene?
If so:
- Dialogue System: Deactivate the Canvas GameObject. When returning to a gameplay scene, reactivate it.
- Quest Machine: Deactivate the Quest Machine Canvas GameObject. When returning to a gameplay scene, reactivate it.
Re: Main Menu & Quest Machine
Is there any coding or button that can deactivate and reactivate it back?
Re: Main Menu & Quest Machine
Yes. In code:
where ... is true or false depending on whether you want to show or hide the UIs.
Code: Select all
DialogueManager.instance.GetComponentInChildren<Canvas>().enabled = ...
QuestMachineConfiguration.instance.GetComponentInChildren<Canvas>().enabled = ...
Re: Main Menu & Quest Machine
What you meant is to add these two line codes in my coding right? I have checked these scripts and both of them are using namespace. How to add them into my script as the red lines appear below the DialogueManager and the QuestMachineConfiguration?Tony Li wrote: ↑Sun Aug 25, 2019 9:00 pm Yes. In code:
where ... is true or false depending on whether you want to show or hide the UIs.Code: Select all
DialogueManager.instance.GetComponentInChildren<Canvas>().enabled = ... QuestMachineConfiguration.instance.GetComponentInChildren<Canvas>().enabled = ...
Sorry, I am not familiar with the namespace.
//Update: Manage to solve the error - add the 'using PixelCrushers.QuestMachine;' will do.
Just wondering why do my buttons deactivate after restarting the game, but the HUD and alert texts work fine?
Re: Main Menu & Quest Machine
If I understand you correctly, this is because the Dialogue Manager and Quest Machine GameObjects survive scene changes, so they are present and ready to display content when needed after restarting the game.
Re: Main Menu & Quest Machine
Can you explain more about the survive scene? And how can I solve this issue?
Re: Main Menu & Quest Machine
Can you describe the problem again please? If possible, please add some screenshots that show the issue.