Retrieve Creator name

Hi,

is it possible to retrieve the player name (as assigned with AuthenticationService.Instance.UpdatePlayerNameAsync(playerName)) from a Creator Id from Unity UGC Service?

I only see how to retrieve the name of the current player with AuthenticationService, but I’d like to show the names of the creators besides their content.

Hello

It is currently not possible to retrieve other player names directly from the client, it is something we will investigate on how to integrate to UGC in the future.

4 Likes

Hey,
A workaround to get the names displayed would be a cloud code module. For example like this:

    [CloudCodeFunction("GetName")]
    public async Task<string> GetName(IExecutionContext context, IGameApiClient gameApiClient, string playerId)
    {
        var response = await gameApiClient.PlayerNamesApi.GetNameAsync(context , context.ServiceToken, playerId);
        return response.Data.Name;
    }
1 Like