Page 1 of 1

How to open quest log with UI button.

Posted: Mon Nov 06, 2023 9:23 am
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?

Re: How to open quest log with UI button.

Posted: Mon Nov 06, 2023 10:00 am
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