If you were to test this now, you would see that a value gets created in our pause menu, but the value is 0. This is not correct because our character is supposed to start with 100 HP according to the character's current stats:
The problem occurs because the Field Player that accesses the pause menu never assigns any of our character data to Character Target. We can easily set the proper character target in Blueprint, but we won't be able to assign any of the character data without exposing our added party members to Blueprint. So, we must first head into RPGGameInstance.h
and allow the exposure of our current game data to a Game Data category of Blueprint in the UProperty
parameters:
UPROPERTY( EditDefaultsOnly, BlueprintReadOnly, Category = "Game Data" )
Your RPGGameInstance
.h
file should now look like this:
#pragma once #include "Engine/GameInstance.h" #include "GameCharacter.h" #include "RPGGameInstance.generated.h" /** * */ UCLASS() class RPG_API URPGGameInstance...