- Photon Insiders Stream - Fireside Chat - Host Migration (01 Mar 2022)
- Before You Start
The Fusion Host Migration sample presents how to migrate the host in
HostMode to another client after the original host dropped out of the session.
NOTE: For the full explanation of the Host Migration API please refer to the Manual page on Host Migration.
Photon Insiders Stream - Fireside Chat - Host Migration (01 Mar 2022)
Before You Start
To run the sample, first create a Fusion AppId in the PhotonEngine Dashboard and paste it into the
App Id Fusion field in
PhotonAppSettings (reachable from the Fusion menu). Then load the
Game scene and press
|1.1.6||Apr 13, 2023||Fusion Host Migration 1.1.6 Build 176|
GameController.prefab: responsible for controlling the game itself and performing the
FusionRunner.prefab: the Fusion
NetworkRunnerprefab with all that is necessary for Fusion to run properly. This prefab will be used to create the
NetworkRunnerswhen the game is running.
Goal.prefab: simple game objective, to where players should drag the interactable objects.
Interactable.prefab: the interactable objects that are pulled in the direction of players.
Player.prefab: player prafab.
Game- The main scene of the sample, contains only the basic ground level and the necessary prefabs to run the Game. Once launched, it will show a Start Menu in order to start the Client and connect to a random game or create a new one.
GameController: this class is the main entry point of the sample. It is responsible for managing the
NetworkRunners, connecting and creating sessions, but most importantly, performing the Host Migration. Check the code at
GameController.OnHostMigrationfor more information.
GoalController: controller of the
Goalprefab. It will detect the presence of an
Interactableand call the logic to increase the score of Players.
InteractableController: controller of the
Interactableprefab. It will check for any nearby player and move towards it as if it was being attracted by the player.
PlayerController: controller of the
Playerprefab. It will move the player based on the moving direction.
ConnectionTokenUtils: a set of utility methods to create Unique Tokens used by the clients to identify themselves.