How to open quest log with UI button.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

How to open quest log with UI button.

Post by VillVarh »

I have added quest log window hotkey component. When I set a key the window will open but when I type my buttons name to "Button Name" it doesn't do anything. How can I open the quest window with my button?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to open quest log with UI button.

Post by Tony Li »

Hi,

Configure your UI button's OnClick() event to call the quest log window's Open() method.

Note: The quest log window is typically in the Dialogue Manager's hierarchy, so it survives scene changes. In this case, your UI button should also be in the Dialogue Manager's hierarchy or marked Don't Destroy On Load so it survives scene changes. If you don't want to do that, use FindObjectOfType<QuestLogWindow>().Open() to open the quest log window. Related explanation: How To: Manage Player Controls and Scene Changes
Post Reply