Functions Reference
GameMaker Studio · GML · Players
gmda_getPlayername
Returns the current player's display name (read from the local cache).
Synchronous (returns directly)
Signature
gmda_getPlayername() -> stringWhat it does
Reads the player name cached locally from the session. No network call.
Parameters
This function takes no parameters.
How to call it
Read it any time after the session_started event.
Returns: The player's nickname (server-generated). Empty until the session starts.
Example
draw_text(8, 8, gmda_getPlayername());Use cases
- Show the player's name in a HUD or profile screen.