godotengine / godot-ios-plugins

MIT License
126 stars 48 forks source link

Game Center not working in Godot editor #30

Closed indiejames closed 2 years ago

indiejames commented 2 years ago

I am unable to use the Game Center plugin in the editor (v3.3.4 on MacOS). I have downloaded the latest release (plugins_3.3.zip) and copied the gamecenter directory into the ios/plugins folder under res://. I have added the following code to my project in my scene's _ready function:

if Engine.has_singleton("GameCenter"):
        game_center = Engine.get_singleton("GameCenter")
        game_center.authenticate()
else:
        print("iOS Game Center plugin is not available on this platform.")

This always fails to find the GameCenter singleton (prints out "iOS Game Center plugin is not available on this platform."). Perhaps there is some step I am missing? I do see 'GameCenter' under plugins when I got to Export/IOS.

I do not know if this is working on device as I am unable to build for iOS at the moment due to Fastlane issues.

naithar commented 2 years ago

iOS plugins are iOS specific, so they are available only on iOS device or simulator. You have to export the game to iOS and run it.