Page cover

Get RPG Reference of a Player

To access to the RPG functions you always need to get the RPGSystem Component reference of the player.

Using GetPlayerCharacter

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.

Getting the Reference through Server

If you are on a server environment then you can use GetConnectedPlayer() from the GameMode. It outputs the RPGSystem Reference.

Only works if executed from the server

Getting PlayerCharacter Reference throught the RPGSystem Reference.

Just use GetOwner() on the RPGSystem Reference to get the PlayerCharacter reference

Last updated