I implemented a leaderboard in my game using Unity Game Services and it was working perfectly last night in unity play. I was able to save scores and see the leaderboard, rename my player’s name, etc. BUT today without me having changed anything in the code a friend reported that leaderboards weren’t working anymore and I checked myself and I saw the logs and found this error message:
[LeaderboardManager] Reason: ServiceUnavailable, Message: Unknown Error
which comes from a LeaderboardsException in the GetScoresAsync:
try
{
var result = await LeaderboardsService.Instance.GetScoresAsync(leaderboardId, new GetScoresOptions { Limit = 10 });
return result.Results;
}
catch (LeaderboardsException leaderboardEx)
{
Debug.LogError($"[LeaderboardManager] Reason: {leaderboardEx.Reason}, Message: {leaderboardEx.Message}");
throw;
}
I tried uploading the exact same build to itch.io: Graveyard Groundskeeper by siflou and the leaderboard works perfectly to There has to be something wrong with how my build is configured with Unity Play or something because I’m able to pull that same production leaderboard locally without problem and I’m seeing all the scores but somehow on Unity Play today it’s not working. I’m seeing some error logs CSP messages in the F12 debug console just before it gets to my exception logs, for example:
Fetch API cannot load https://leaderboards.services.api.unity.com/v1/projects/642015b7-6ccc-4d45-b03c-cccf92a287df/leaderboards/GraveyardGroundskeeper/scores/players/DJLExNpBSDbm8XPVoN4UaWNnJYnr. Refused to connect because it violates the document’s Content Security Policy
Can someone help?
Here’s the link to my game if you want to try to reproduce it.
Thank you!