When the ShowScores button is pressed, the game will attempt to show the leaderboard.Google Play services is the API layer that enables unique Google features onĪndroid. The example below is from the GameOverButtons Blueprint Widget in the Unreal Match 3 sample game. The Show Platform Specific Leaderboard Screen will show the leaderboard specified by Category Name on the device. There is some additional checking before this to see if the new highscore is more than the one that was pulled during the app startup, but even if that wasn't there, the iOS and Android leaderboard systems will only accept values greater than what they currently store. When the victory (or defeat) screen is shown, it will check to see if on load Unreal Match 3 was able to retrieve a high score, then if it was able to it will submit the latest high score to the leaderboard. The example below is from the VictoryScreen Blueprint in the Unreal Match 3 sample game. The Write Leaderboard Integer node will send the given integer Stat Value to the leaderboard specified in Stat Name for the provided Player Controller. In these few nodes we're calling the Read Leaderboard Integer node for the Player Controller at Player Index 0 on the Stat Name (Leaderboard) "Match3HighScore": The example below is from the Global Game Instance Blueprint in the Unreal Match 3 sample game. The value of Leaderboard Value before a successful return (or if the service fails to get a response) will be 0.
The other two pins ( On Success, and On Failure) will execute when the online service returns (or fails to return) a value. The top most is a "pass through," that works like any other execution output pin. Note that it is a latent node, and thusly has a number of execution output pins. The Read Leaderboard Integer node will request from the platform's game service (currently iOS Game Center, or Google Play Services), the value stored on the given Stat Name for the provided Player Controller.