question

shootertutorial@gmail.com avatar image
shootertutorial@gmail.com asked

How to use Leaderboards (post scores) in UE4?

I'm using Unreal Engine 4 Blueprints SDK and I don't know how to send leaderboard (stat) data and receive it. There is Update Statistics Node but how to use it? 

UE4 support is really lacking documentation right now...

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

We'll be working to add more documentation for each of the SDKs, but for right now, the primary resource is the Web API documentation, which details what each call does, including its inputs and outputs. Blueprints in Unreal are a bit of a unique case, since unlike most of our SDKs, it's a visual scripting language. But, if you're already familiar with how Blueprints work, it should be relatively easy to relate the parameters and response values from our API docs to their usage in the nodes.

Specifically for statistic reporting, you would need to first have a signed in player, using one of the Login methods available (such as the one described in the main readme: https://github.com/PlayFab/UnrealBlueprintSDK/blob/master/README.md). Once that's done, and assuming you've given the client the ability to post statistics (in Settings->General for your game in the PlayFab Game Manager), you would then post the stat using UpdateUserStatistics (the Update Statistics Node), passing in the stat and its value.

However, it's worth noting that the reason the client permission for stats is off by default is because anything the client is authoritative over is an opportunity for a player to cheat that data, so we generally encourage using Cloud Script (https://api.playfab.com/docs/using-cloud-script/) for writing stats, so that you can have code which checks for potential cheating (posting too often, or too high/low of scores, for instance).

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.