Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Numli · Aug 07, 2014 at 04:08 AM · iosleaderboardgamecenterimplementation

ShowLeaderboardUI not implemented???

Hi All, I have been looking at this for hours now and cant find a solution to it. I am trying to implement a simple leaderboard from Game Centre for my iOS game, I have it working it native iOS code (for a dummy app) so I know its configured right at Apples End but for some reason its not working in unity or on a device after building it. My Code is as follows, I have omitted irrelevant bits.

 import UnityEngine.SocialPlatforms.GameCenter;
 import UnityEngine.SocialPlatforms;
 //LeaderBoard Button
         if(GUI.Button(Rect(Screen.width/2 - bigBtnWidth/2, Screen.height - btnHeight*6,bigBtnWidth,btnHeight),"L E A D E R B O A R D", emptyGUI)){
             btnPressSound.Play();
             Debug.Log("LeaderBoard Button Pressed");
             
             
             Social.localUser.Authenticate (function (success) {
         if (success) {
             Debug.Log ("Authentication successful");
             noticeText = "Success";
             var userInfo : String = "Username: " + Social.localUser.userName + 
                 "\nUser ID: " + Social.localUser.id + 
                 "\nIsUnderage: " + Social.localUser.underage;
             Debug.Log (userInfo);
             Social.LoadScores("riftroller_leaderboard",Getscores);
             Social.ShowLeaderboardUI();
         }
         else{
             Debug.Log ("Authentication failed");
             noticeText = "Failed";
             }
             
     });
         }

 function ProcessAuthentication (success: boolean) {
     if (success) {
         Debug.Log ("Authenticated, getting leaderboard");
         noticeText = "Authenticated, Trying LeaderBoard";
         
         //LeaderBoard
            Social.LoadScores("riftroller_leaderboard",Getscores);
            //Social.ShowLeaderboardUI();
     
       }
     else{
         Debug.Log ("Failed to authenticate");
         noticeText = "Failed to authenticate";
         }
 }

 //Get HighScores
 function Getscores(scores: IScore[]){
     if (scores.Length > 0) {
             Debug.Log ("Got " + scores.Length + " scores");
             var myScores = "Leaderboard:\n";
             for(var score: IScore in scores){
                 myScores += "\t" + score.userID + " " + score.formattedValue + " " + score.date + "\n";
             Debug.Log (myScores);
             noticeText2 = myScores.ToString();
             }
         }else{
             Debug.Log ("No scores loaded");
             noticeText2 = "No Scores/Leaderboard";
             
     }
 
 }

Any help for this would be much appreciated!

Thanks in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by sribas · Jul 03, 2017 at 10:09 AM

In case someone gets here because is getting the same error but when trying to use Play Games services (my case):

Add: PlayGamesPlatform.Activate ();

In your start or awake method.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by fadsel · Dec 22, 2015 at 01:09 PM

This question appears to be old but for future references ,

You need to replace The default configuration with a custom configuration i.e game centre , what you did was .... you started authenticating the local user

Hope this helps someone :)

Cheers

If you found this helpful, Go play sticky bubble on Google Play

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by fedecaccia · Jan 09, 2016 at 05:36 PM

where can i set that things?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Gamecenter leaderboards? 1 Answer

Can't call GameCenter in my Unity game for iOS 0 Answers

On iOS .. actually go to the GameCenter app? 1 Answer

Game Center login issue 0 Answers

Game Center ReportScore & Leaderboard 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges