Page 1 of 1
Hide Quest HUD on Conversation start
Posted: Tue Aug 15, 2023 8:34 pm
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?
Re: Hide Quest HUD on Conversation start
Posted: Wed Aug 16, 2023 8:31 am
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();
}
Re: Hide Quest HUD on Conversation start
Posted: Wed Aug 16, 2023 11:34 pm
by Vard
Thanks! worked perfectly and much easier than having boilerplate in every conversation
Re: Hide Quest HUD on Conversation start
Posted: Thu Aug 17, 2023 7:28 am
by Tony Li
Glad to help!