A
A
AlxWanderer2019-02-08 21:39:59
Unity
AlxWanderer, 2019-02-08 21:39:59

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

2 answer(s)
A
AlxWanderer, 2019-02-08
@AlxWanderer

Here is the top!

private string leaderboard = "CgkzIif6px6ATHAIHTA";
        public Text ScoreText;
        public Text HighScoreText;

        private int _score;
        public int Score

I don't know, maybe I'm wrong! Already this way and that, but everything is not like! Maybe you know how to solve!

D
Denis Gaydak, 2019-02-08
@MrMureno

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 question

Ask a Question

731 491 924 answers to any question