기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Multiplayer Services SDK

All Services

Multiplayer Services SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
  • Manage sessions
    • Lobby events
    • Rate limits
    • Information management in sessions
    • Synchronize player names in a session
    • Access control
    • Session error messages
  • Connect players through a relay
  • Networking
  • Matchmaking
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Synchronize player names in a session

Expose and read player display names as session player properties so all players can view each other's names.
읽는 시간 2분
최근 업데이트: 6달 전

When a player is authenticated through the Authentication service, you can write the player's name into the session as a player property, and update it during the session lifecycle.
You can achieve this functionality using the following two extension methods:
  • WithPlayerName(VisibilityPropertyOptions visibility)
    to enable synchronization on session creation and join.
  • GetPlayerName()
    to read the name from any session player.

Enable player name sync in session options

Use
WithPlayerName
to synchronize the player's authenticated name into the session with a chosen visibility. The following example demonstrates how to enable player-name synchronization on session creation:
var myPlayerName = "CustomName";await UnityServices.InitializeAsync();await AuthenticationService.Instance.SignInAnonymouslyAsync();await AuthenticationService.Instance.UpdatePlayerNameAsync(myPlayerName);// Configure your session and enable name sync (member visibility makes it readable by other members)var sessionOptions = new SessionOptions{ MaxPlayers = 4, Type = "Session"}.WithPlayerName(VisibilityPropertyOptions.Member);
참고
Use
VisibilityPropertyOptions.Member
or
VisibilityPropertyOptions.Public
so other players can read the name. Use
VisibilityPropertyOptions.Private
if you don't want names to be visible to others. In that case, other players’
GetPlayerName()
calls return
null
.

Read player names from the session

Use
GetPlayerName
to retrieve the synchronized name from any player’s properties.
// Read your own player name (from the local session player)string myName = session.CurrentPlayer.GetPlayerName();// Read other players’ namesforeach (var player in session.Players){ var name = player.GetPlayerName() ?? $"Player {player.Id}"; UnityEngine.Debug.Log($"Player {player.Id} name: {name}");}
If a name isn’t available for any reason,
GetPlayerName()
returns
null
. For example, a name might be unavailable because the player hasn’t set a name, or the property isn't visible.
The player must be signed in and have a player name available via the Authentication service. Synchronization occurs while the session is connected. Updates made while disconnected won’t propagate until reconnected.

Additional resources

  • Authentication
  • Session operations as a host

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Enable player name sync in session options

    • Read player names from the session

    • Additional resources


이 페이지의 문제 보고