Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Bonkahe · Jul 20, 2016 at 06:40 PM · c#google playleaderboards

google leaderboard troubleshooting

Hey, I've been working on a little game, and decided I was to the point where I needed to get some leaderboards in there, I went with the google play leaderboards for ease of use, and after a psychotic amount of issues I eventually got everything working, its now building without error, and everything's going perfectly, except now the leaderboard simply wont show up. So first off I'm gonna show you my code, its pretty simple stuff I just pulled from a tutorial I found.

 using UnityEngine;
 using System.Collections;
 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 using UnityEngine.SceneManagement;
 
 public class HighScoresBehavior : MonoBehaviour
 {
     #region PUBLIC_VAR
     public string leaderboard;
     #endregion
     #region DEFAULT_UNITY_CALLBACKS
     void Start()
     {
         // recommended for debugging:
         PlayGamesPlatform.DebugLogEnabled = true;
 
         // Activate the Google Play Games platform
         PlayGamesPlatform.Activate();
     }
     #endregion
     #region BUTTON_CALLBACKS
     /// <summary>
     /// Login In Into Your Google+ Account
     /// </summary>
     public void LogIn()
     {
         Social.localUser.Authenticate((bool success) =>
         {
             if (success)
             {
                 Debug.Log("Login Sucess");
             }
             else
             {
                 Debug.Log("Login failed");
             }
         });
     }
     /// <summary>
     /// Shows All Available Leaderborad
     /// </summary>
     public void OnShowLeaderBoard()
     {
         //        Social.ShowLeaderboardUI (); // Show all leaderboard
         ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard); // Show current (Active) leaderboard
     }
     /// <summary>
     /// Adds Score To leader board
     /// </summary>
     public void OnAddScoreToLeaderBorad()
     {
         if (Social.localUser.authenticated)
         {
             Social.ReportScore(1, leaderboard, (bool success) =>
             {
                 if (success)
                 {
                     Debug.Log("Update Score Success");
 
                 }
                 else
                 {
                     Debug.Log("Update Score Fail");
                 }
             });
         }
     }
     /// <summary>
     /// On Logout of your Google+ Account
     /// </summary>
     public void OnLogOut()
     {
         ((PlayGamesPlatform)Social.Active).SignOut();
     }
     #endregion
 
     public void exit()
     {
         SceneManager.LoadScene(0);
     }
 }


So basically I drop into a new scene (to simplify things I just made the highscores in their own scene that you navigate to from the main menu), then you're presented (for now) a few buttons, first is a debug button that (should) add a point on the leaderboard, a log into google option, a log out of google option, and a show leaderboards option, also a quit to menu button. The only button that functions is the log in button, it loads up on my phone googles options to log in, and I log in no problem, heres where it's weird. My logcat swears that I didn't log in successfully.

alt text

(Hope I didn't include any sensitive info) But on my phone it works fine, also whenever I press any button (except quit) it doesn't say a word, acts like I didn't press a thing.

Any thoughts? suggestions?

UPDATE: Just now I tried again and its just throwing login failed (from debug.log) each time, and this time its legitimately not showing that I logged in on my phone.

issues.png (38.4 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bonkahe · Jul 21, 2016 at 11:58 AM

Hey, figured this one out, for anyone going down this same path, public string leaderboard;

Needs to be set to your leaderboard ID, you can find it in the developer console to the right of the individual leaderboard icon. Good Luck

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Achievements Google Play. 1 Answer

build error,please help!i checked for duplicate files and there are none.plug(admob) in is working fine in other projects,completely deleted and reimported everything and that did not help too,please let me know the solution for this. 0 Answers

Illuminating a 3D object's edges OnMouseOver (script in c#)? 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