Quest tracking

If you followed the Your First Quest example, you have a quest that can be played but you have no UI elements telling you what to do. This page explains getting quest data from the quest subsystem so you can show it on the game HUD.


Quest Widget

The quest system plugin comes with a sample widget for tracking Quests called WBP_QuestWidget. You can find in the plugin's content folder at Plugins/QuestSystemContent/Widgets. Feel free to edit it or create your own widget for your project needs. The quest widget has a text block to show the quest's name and another text block to show Objective's name. This widget only supports one objective but the quest system itself supports multiple objectives to be active at a time per quest.

The widget comes with two functions. The SetTrackedQuest function sets the quest trcked by the widget. It first untracks any currently tracked quest, binds to state change delegates for actions inside the quest so it can update the objective text, and sets the quest name and objective name.

The UnsetTrackedQuest function removes the bindings to state change delegates and sets the quest and objective text to empty texts.


Adding names to the quest

Before quest names can be displayed on the widget, the quest itself and the objectives need to have a name to display. If you followed along with the Your First Quest example, Open the quest asset and do the following:

  1. Give the quest a name by setting the Quest Name field. This example has the quest named Sample Quest.

  2. Select the Reach location node and give it a name. This example has the objective named Go near the platform.

  3. Select the Eliminate Targets node and give it a name. This example has the objective named Destroy the cube.


Displaying quest widget on the HUD

Now that you have a quest with names and a quest widget to show the names, it is time to add the widget on the HUD for the players to see.

  1. Open the BP_FirstPersonPlayerController blueprint. From the Event Begin Play function, extend from the Add Mapping Context node and add a Create Widget node. Set the widget class to WBP_QuestWidget.

  2. Get Quest Subsystem, get quests array from the subsystem and get the quest at index 0. Call Set Tracked Quest function on the quest widget and give it the quest at index 0.

  3. Add the quest widget to the viewport. Compile the blueprint.

  4. When quests are loaded from the archive during game mode's begin play event, the asynchronous loading takes a while to complete and the quest widget is created before quests are loaded. To fix this, bind a custom event to OnQuestsLoaded event of the Quest Subsystem. On the custom event call SetTrackedQuest with the first available quest as the tracked quest.

Play the game and the quest should be visible on the screen.


The plugin does not have out of the box support for world markers for the objectives.