Get RPG Reference of a Player
Last updated
Last updated
To access to the RPG functions you always need to get the RPGSystem Component reference of the player.
Keep in mind that GetPlayerCharacter()
only returns the local character reference and should only be used for Client-Side stuff in Multiplayer. (Inside widgets for instance). Make sure to always grab the replicated reference of a PlayerCharacter!
If you want to go for Singleplayer only then feel free to use it anywhere.
If you are on a server environment then you can use GetConnectedPlayer()
from the GameMode. It outputs the RPGSystem Reference.
Just use GetOwner()
on the RPGSystem Reference to get the PlayerCharacter reference