Hi,
A couple of days ago I re-ordered my project and when short-cutting directly into a game-scene for the sake of play-testing, I found that GetScoresAsync() hung.
Task GetScores = LeaderboardsService.Instance.GetScoresAsync(leaderboardID, new GetScoresOptions { Limit = maxNumberOfScoresInLeaderboard });
Somehow, Unity got stuck in this call and never got out without any exception being thrown or whatever.
It took me a while before I realised that due to the short-cut I took, the ‘UnityServices.InitializeAsync()’ method never got called. After fixing this, it worked again.
Is this a correct observation or am I completely overseeing something else maybe?
This is most likely to be the case. If you miss initializing the services then you won’t be able to authenticate the user, this will prevent you from calling the service which is why you were experiencing the hang.
Thanks. Actually, I not only ‘forgot’ to initialize the service but also forgot to sign in anonymously before calling GetScoresAsync(). Hence, I didn’t stumble upon an error when signing in (because I didn’t try signing in).
But still…the hanging behaviour -even given the circumstances- seems like a valid bug to me. There should always be a way somebody gets noticed something is wrong and the routine shouldn’t be busy waiting and never return instead…right?
1 Like