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
3
Question by DA_ATeam · Dec 30, 2011 at 04:14 AM · leaderboardbetagamecenterachievements

How To Build A Leaderboard Using Unity 3.5 Beta

Unity 3.5 Beta is a fantastic gift this Holiday Season! There are so many levels and components to Unity one can barely become proficient before exciting new featurs are added. On that note, I'm using 3.5B to build an IOS game that requires a leaderboard. Through a post on the Forum I was able to find the Social API in the Documents directory. I created a Javascript named Authenticate and pasted the following Social API code. I got this error: (7,12): BCE0019: 'Authenticate' is not a member of 'UnityEngine.Social'.

 function Start ()
 {
     // Authenticate and register a ProcessAuthentication callback
     // This call needs to be made before we can proceed to other calls in the Social API
     Social.Authenticate( ProcessAuthentication );
 }
 
 // This function gets called when Authenticate completes
 // Note that if the operation is successful, Social.localUser will contain data from the server. 
 function ProcessAuthentication( success: boolean)
 {
     if (success)
     {
         Debug.Log("Authenticated, checking achievements");
 
         // Request loaded achievements, and register a callback for processing them
         Social.LoadAchievements(ProcessLoadedAchievements);
     }
     else
         Debug.Log("Failed to authenticate");
 }
 
 
 // This function gets called when the LoadAchievement call completes
 function ProcessLoadedAchievements(cache: Achievement[])
 {
     if (cache.Length == 0)
         Debug.Log("Error: no achievements found");
     else
         Debug.Log("Got " + cache.Length + " achievements");
 }


I have no idea what to do with the API, if it had loaded, but I know it's not good to start off getting errors right off the bat. I created an empty game object I had planned to attach the script to but the error killed that approach deader than a door knob. My question then, is can someone give us(the forum showed more 3.5 users with GameCenter questions) a step by step on how to build a simple basic GameCenter Leaderboard using the Social API? I've setup 'GameCenter' in iTunes Connect. Have loaded the GameCenter Framework in Xcode. Read documentations. I'm all dressed up and ready to go! Help!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by DA_ATeam · Jan 14, 2012 at 11:43 PM

Oooook! I added a little Pixie Dust to my cinnamon oatmeal this morn, and BAM! Game Center pops up on the development build on my iPad! Now I get a a Game Center box message asking me to sign in. After signing in, I get an error message saying 'This game is not recognized by Game Center. I imagine this is because I haven't enabled Game Center in iTunes Connect yet. Excuse me a moment while I 'Tebow' So, here's the drill for others who've never attempted this amazing feat at home.

1. Create a new Javascript in Unity. I named it Game Center **2.**Copy and Paste the Social API code into your new Game Center script. 3. Edit your code; changing 'Social.Authenticate', to 'Social.Default.Authenticate' 4.In a new scene, or an appropriate scene, create an empty game object and add the script 'Game Center'. (I added 'Game Center' script to my existing Total Points scene. 5. Go into Xcode and add the Game Kit framework to your project. Very Important Step! 6. Go to you Project in Xcode >Click on Target > Build Phases > Click on the '+' sign and add the Game Kit. (on the far right side of this line I changed 'optional' to 'required' Don't know if that's mandatory or not). 7.Connect your iPad or iPhone 8.* Back in Unity 3.5 Beta, Hit build and run! Game Center sign in box should appear.

If you don't know! Now you Know. Brother!

Comment
Add comment · Show 2 · 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 infinitypbr · Dec 14, 2012 at 02:04 AM 0
Share

This worked for me, although I did not have to do steps 3, 5 or 6.

avatar image SamyBencherif · Jun 15, 2015 at 04:29 AM 0
Share

Thank you very much this is extraordinarily helpful! In unity 5 replace Social.Authenticate to Social.localUser.Authenticate

avatar image
0

Answer by pepefirst · Apr 19, 2012 at 03:49 PM

This is the best description I ever have seen on how to implement Game Center on Unity. You go step by step on it. Thanks for your help!

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

GameCenter Leaderboar and Achievements at Once... 2 Answers

Social.ShowAchievementsUI() not showing achievements 1 Answer

iOS Game Center Achievements Not Working 1 Answer

Achievements and Leaderboard for Unity Windows 10 games 1 Answer

Google Play Services leaderboard takes time to appear 0 Answers


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