Access Alert [SOLVED]

Announcements, support questions, and discussion for Quest Machine.
Post Reply
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Access Alert [SOLVED]

Post by mschoenhals »

Hi,
Is it possible for other scripts to access the Alert HUD? How would I do that?
Last edited by mschoenhals on Sun Dec 29, 2019 8:05 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Access Alert

Post by Tony Li »

Hi,

In script, you can use QuestMachine.defaultQuestAlertUI.ShowAlert. There are 3 variations that allow you to show different types of content. The simplest is a text string:

Code: Select all

QuestMachine.defaultQuestAlertUI.ShowAlert("Hello world");
If you want to hook up a UnityEvent in the inspector, add a QuestControl component, and configure the event to call QuestControl.ShowAlert.
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Re: Access Alert

Post by mschoenhals »

This works perfectly!
Thank you. :D
Post Reply