You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use the GameCenter Plugin, but it not works.
I use this piece of code:
ifEngine.has_singleton("GameCenter"):
print("Gamecenter aktiv")
game_center=Engine.get_singleton("GameCenter")
varlogin=game_center.authenticate()
varresult=game_center.post_score({ "score": 100, "category": "birds_4", })
varshow=game_center.show_game_center({ "view": "leaderboards", "leaderboard_name": "birds_4" })
else:
print("iOS Game Center plugin is not available on this platform.")
Without the part game_center.authenticate() I get the error "player is nil". With this part the game_center open on iOS. Is there any function to authenticate without open gamecenter?
In the documentation is the dictionary a litte bit unclear. On one section the key called "score" in another section "value".
Without the part game_center.authenticate() I get the error "player is nil". With this part the game_center open on iOS. Is there any function to authenticate without open gamecenter?
You should always authenticate user to use GameCenter functionality. On real device GameCenter controller will display single time.
Tested your project, I'm not getting the error that you have posted, but I'm getting script error:
2021-12-10 10:37:52.737761+0300 testapp[10264:10008889] 0
2021-12-10 10:37:52.737901+0300 testapp[10264:10008889] SCRIPT ERROR: Invalid operands 'String' and 'int' in operator '+'.
2021-12-10 10:37:52.738065+0300 testapp[10264:10008889] at: _on_gamecenter_pressed (res://Control.gdc:50) - Invalid operands 'String' and 'int' in operator '+'.
You shouldn't use + sign for String and int which is result of methods, str(result) should help you with that.
Also category is a leaderboard identifier, not it's name, so this also can be an issue.
Edit:
Also, to test InAppPurchases you have to use TestFlight version of app or create StoreKit Configuration File, which will allow to test purchases in debug mode.
Hello there,
I try to use the GameCenter Plugin, but it not works.
I use this piece of code:
Without the part game_center.authenticate() I get the error "player is nil". With this part the game_center open on iOS. Is there any function to authenticate without open gamecenter?
In the documentation is the dictionary a litte bit unclear. On one section the key called "score" in another section "value".
Furthermore I get the following error:
on this link you get a little project, with a gamecenter function and a in app purchase function. Both not working.
https://1drv.ms/u/s!Ah2_A51TSFE1g7k0x5ylXLWFpLmoJQ?e=x1W2lU
thanks
The text was updated successfully, but these errors were encountered: