Answer the question
In order to leave comments, you need to log in
Problem with leaderboard in PlayMaker(GooglePlay) in Unity, how to fix it?
The essence of the problem is that it seems to have connected everything you need, but no matter how many points you score, they are not taken into account in the leaders!
Here is the script!
public int Score
{
get { return _score; }
set
{
_score = value;
ScoreText.text = _score.ToString();
if (PlayerPrefs.GetInt("HighScore") < _score)
{
PlayerPrefs.SetInt("HighScore", _score);
HighScoreText.text = _score.ToString();
//
Social.ReportScore(_score, leaderboard, (bool success) =>
{
if (success) print ("Good Add leaderboard");
});
//
}
}
}
Answer the question
In order to leave comments, you need to log in
Here is the top!
private string leaderboard = "CgkzIif6px6ATHAIHTA";
public Text ScoreText;
public Text HighScoreText;
private int _score;
public int Score
https://docs.unity3d.com/ScriptReference/Social.html
let me guess. are you trying this not on iOS...???
read. Social in the unit for GameCenter only. if you need a PC or android - look for plugins.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question