GameCenterManager

Inherits: RefCounted < Object

Entry point for authenticating the Apple Game Center local player.

Description

Create a GameCenterManager when your game starts to present Apple’s authentication UI and track whether the player is signed in, as described in GameCenterGuide.md. Once authenticated you can fetch the local_player to access achievements, leaderboards, friends, and matchmaking helpers. See Apple’s documentation for Apple’s GKLocalPlayer reference to learn more about the underlying authentication flow.

Authentication example from the guide:

var game_center: GameCenterManager

func _ready() -> void:
    game_center = GameCenterManager.new()

    game_center.authentication_error.connect(func(error: String) -> void:
        print("Received error %s" % error)
    )
    game_center.authentication_result.connect(func(status: bool) -> void:
        print("Authentication updated, status: %s" % status)
    )

Properties

GKLocalPlayer

local_player

Methods

void

authenticate()


Signals

authentication_error(arg1: String) 🔗

Emitted whenever GameKit authentication fails. The argument is the localized error string provided by Apple.


authentication_result(arg1: bool) 🔗

Emitted after authenticate() finishes. The boolean is true when GKLocalPlayer.local.isAuthenticated reports success.


Property Descriptions

GKLocalPlayer local_player 🔗

Returns the wrapper for GKLocalPlayer.local. Use this after successful authentication to call methods such as load_friends() or fetch_items_for_identity_verification_signature().


Method Descriptions

void authenticate() 🔗

Triggers GKLocalPlayer.authenticateHandler, presenting Apple’s login sheet when needed. Emits authentication_result with the new status and authentication_error if GameKit reports a failure.