> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lobby.TryGetOwner

> Lobby.TryGetOwner

# Lobby.TryGetOwner method

Tries to get the current owner of the lobby. Returns false and sets owner to null if there is no owner on this Lobby

```csharp theme={null}
public bool TryGetOwner(out PFEntityKey owner)
```

| parameter | description                                                                                                                                       |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| owner     | The output owner. This value may be null if the owner has left or disconnected from the lobby while the owner migration policy is Manual or None. |

## Return Value

true if an owner is found or false otherwise

## Remarks

If this lobby object was created by calling [`JoinLobby`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/JoinLobby), this method returns false and the owner is null until [`ProcessLobbyStateChanges`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/ProcessLobbyStateChanges) provides a [`OnLobbyUpdated`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyUpdated) with the `OnLobbyUpdated OwnerUpdated` field set to true. If joining the lobby succeeds, this field is guaranteed to be populated by the time [`ProcessLobbyStateChanges`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/ProcessLobbyStateChanges) provides a [`OnLobbyJoinCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted).

## See Also

* class [PFEntityKey](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PFEntityKey/overview)
* class [Lobby](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview)
* namespace [PlayFab.Multiplayer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference)


## Related topics

- [PFLobbyGetOwner](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetowner.md)
- [Lobby.TryGetServer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/TryGetServer.md)
- [PFLobbyGetRestrictInvitesToLobbyOwner](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetrestrictinvitestolobbyowner.md)
- [PFLobbyGetOwnerMigrationPolicy](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetownermigrationpolicy.md)
- [Lobby ownership changes](/services/playfab/multiplayer/lobby/ownership-changes.md)
