Adding a UI indicator to the companion pawn
Now that our character is moving through the world, we're going to give it another behavior state and allow the player to instruct it to wait.
Before we create this new state, however, we're first going to create a simple UI element to indicate the companion character's current state. We'll build it as a placeholder first, since we haven't yet created its new state, and then, once we have, we'll update it to reflect the real underlying data.
Creating a UI widget using UMG
Unreal provides a powerful tool for constructing UI elements. UMG allows developers to lay out UI elements on a visual layout tool, and to tie Blueprint behaviors directly to the objects in the layout. We call UI elements widgets. Let's learn how to create them:
- In your project's
Content
directory, right-click to create a new asset. SelectUI
|Widget Blueprint
:
- Name it
WBP_CompanionIndicator
and open it up.
You'll be presented with the UMG UI Designer.
Note
Unreal offers two toolsets...