Referencia de funciones
Godot 4 · GDScript · Setup & session
get_player_id
Returns the current player's unique id.
Synchronous (returns directly)
Signature
get_player_id() -> StringWhat it does
Reads the player's id cached locally from the session. No network call.
Parameters
This function takes no parameters.
How to call it
Read it any time after session_started. Do not display it in production builds.
Returns: String (the unique player id).
Example
print("debug player id: %s" % Gamdato.get_player_id())Use cases
- Reference the player in support tickets or debug logs.