Hot To Use GameCenter in Godot 3.1

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By theruins


I‘m trying to add GameCenter to my game, but the Singleton isn‘t „defined in scope“ and the docs aren‘t really helping me understand how to use it. Any ideas?


:bust_in_silhouette: Reply From: palia5

Use something like this:

var game_center = null

if Engine.has_singleton("GameCenter"):
  game_center = Engine.get_singleton("GameCenter")
  ### call game center method on the game_center variable