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

# Lobby.TryGetOwner

> Lobby.TryGetOwner

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`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/JoinLobby), this method returns false and the owner is null until [`ProcessLobbyStateChanges`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/ProcessLobbyStateChanges) provides a [`OnLobbyUpdated`](https://docs.xbox.com/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`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/ProcessLobbyStateChanges) provides a [`OnLobbyJoinCompleted`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted).

## See Also

* class [PFEntityKey](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PFEntityKey/overview.md)
* class [Lobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview.md)
* namespace [PlayFab.Multiplayer](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference.md)


## Related topics

- [Lobby.TryGetServer](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/TryGetServer.md)
- [PFLobbyGetOwner](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetowner.md)
- [PFLobbyGetRestrictInvitesToLobbyOwner](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetrestrictinvitestolobbyowner.md)
- [PFLobbyGetOwnerMigrationPolicy](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetownermigrationpolicy.md)
- [Real-time messages for Lobby and Matchmaking APIs](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview.md)
