Hide Quest HUD on Conversation start

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Vard
Posts: 7
Joined: Tue Aug 15, 2023 5:34 pm

Hide Quest HUD on Conversation start

Post by Vard »

At the start of every conversation I hide the non-conversation UI. For my custom UI I do this by adding an OnExecute Scene Event to the first node in the conversation (which triggers GameObject.SetActive)

Since the Quest HUD is defined on Dialogue Manager as a prefab not an instance, I can't do this. So how can I hide it when a conversation is active?
User avatar
Tony Li
Posts: 21680
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide Quest HUD on Conversation start

Post by Tony Li »

Hi,

You don't need to add an OnExecute() scene event to every conversation. You can either add a Dialogue System Events component to the Dialogue Manager and/or player and use the OnConversationStart()/OnConversationEnd() events, or add a script with OnConversationStart(Transform) & OnConversationEnd(Transform) script methods.

To access the quest tracker HUD, you can add an instance of the quest tracker HUD to the Dialogue Manager and remove it from the Instantiate Prefabs component, or if you're using a script you can get it and hide it at runtime like:

Code: Select all

void OnConversationStart(Transform actor)
{
    DialogueManager.instance.GetComponentInChildren<StandardUIQuestTracker>().HideTracker();
}
Vard
Posts: 7
Joined: Tue Aug 15, 2023 5:34 pm

Re: Hide Quest HUD on Conversation start

Post by Vard »

Thanks! worked perfectly and much easier than having boilerplate in every conversation
User avatar
Tony Li
Posts: 21680
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide Quest HUD on Conversation start

Post by Tony Li »

Glad to help!
Post Reply