Select your preferred scripting language. All code snippets will be displayed in this language.
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
ClosenewHostInfo | Information about the new host, including the IP address. |
youAreNewHost | True if this client is to be the new host. |
bool True if able to pick a new host.
This is a utility function to pick one of the peers in the game as the new host.
This function implements the default host-choosing strategy of picking the peer with the lowest connectionId on the server.
Applications are not required to use this function to choose the new host. They can use any method they want. The choice does not have to be made synchronously, so it is possible to communicate with an external service to choose the new host.
However, the default UI of the NetworkMigrationManager calls into this function.