Add matchmaking
Pair two players into a room automatically.
1. Enter the queue
Players queue by game mode, region, and match size. Only same-bucket players match.
MultiplayerService.join_matchmaking("duel_1v1", "global", 2, "Alice")
MultiplayerService.matchmaking_queued.connect(func(_m, _r, _s): print("searching…"))
2. Get matched
When the bucket fills, the server creates a room and adds the players — you're already in it.
MultiplayerService.match_found.connect(func(room_id, code, players):
print("matched into ", code, " with ", players.size(), " players")
start_match())
3. Handle timeouts
MultiplayerService.matchmaking_timeout.connect(func(_mode, _region):
print("no opponent — try again"))
# Cancel manually:
MultiplayerService.leave_matchmaking()
4. Play
Once matched you're in a normal room — relay inputs with send_event or sync
positions with entity state.
Full version: the 1v1 Matchmaking Arena example in
sdk/godot-gdscript/examples/matchmaking_arena/.