Displaying stats
Now, we will need to pick a good spot to cast RPGGameInstance. It would be best to cast RPGGameInstance after the pause menu has been created, so link the out pin of the Set Show MouseCursor node to the in pin of the Cast To RPGGameInstance. Then, link the Return Value of the Create Pause_Main Widget to the Target of Set Character Target. When you are finished, your EventGraph under FieldPlayer will look like this:
When you are finished, you will see that the HP of the soldier is displayed correctly as the current HP:
You can now
Get Building an RPG with Unreal 4.x now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.