Skip to content

Player Profile Examples

This section demonstrates how to retrieve and use the current player’s Google Play Games Services profile in Unreal Engine projects. All examples assume that the player is already signed in to Google Play Games Services.

Player profile data is commonly used to display the player’s name or avatar in menus, profile screens, leaderboards, or social UI.


Basic Usage Flow

A typical player profile flow looks like this:

  • The player signs in to Google Play Games Services.
  • The current player profile is requested once.
  • The returned profile data is stored and reused by UI or gameplay systems.

Loading the Current Player Profile

The player profile can be retrieved using a single call and returned asynchronously.

Example scenario: display the player’s display name in the main menu.

Typical usage pattern:

  • Call Get Current Player after the player has successfully signed in.
  • Use On Success to receive an FGooglePlayGamesPlayer structure.
  • Store the returned player data in a variable or manager.
  • Use fields such as DisplayName or profile image URLs to populate UI.

Using Player Data in UI

The returned player structure can be broken into individual fields using Blueprint.

Common use cases:

  • Show DisplayName in menus or profile widgets.
  • Use IconImageURL or HiResImageURL to download and display the player’s avatar.
  • Use PlayerID as a stable identifier for backend or save-game association.

The boolean flags bHasIconImage and bHasHiResImage should be checked before attempting to load profile images.


Important Notes

  • The player must be signed in before calling Get Current Player.
  • Player profile data is read-only and managed entirely by Google Play Games Services.
  • Profile image URLs may be empty depending on player privacy settings.
  • It is recommended to cache the player profile after the first successful load.

These examples cover the most common player profile usage patterns and are sufficient for displaying basic identity information in most games.