Description #
MPConnection is responsible for initiating and managing the connection to Photon Cloud. It regulates room creation, enforces a maximum player count per room, and handles the logon timeout. It also keeps the ‘IsMultiplayer’ and ‘IsMaster’ flags up-to-date, which are frequently relied upon by core classes.
MPConnection is responsible for managing the connection to Photon Cloud in multiplayer games. Customize the variables to configure the connection behavior, debug logging, scene loading, and other connection-related settings according to your game’s requirements.
Inspector Fields #
Log On Time Out #
Type: float
Description: If a stage in the initial connection process stalls for more than this many seconds, the connection will be restarted.
Default Value: 10f
Max Connection Attempts #
Type: int
Description: After this many connection attempts, the script will abort and return to the main menu.
Default Value: 10
Scene To Load On Disconnect #
Type: string
Description: The scene that will be loaded when the ‘Disconnect’ method is executed.
Default Value: “” (empty string)
Debug #
Type: bool
Description: Enable debug logging for the MPConnection component.
Default Value: false
Debug To Game Chat #
Type: bool
Description: Enable debug logs to be displayed in the in-game chat.
Default Value: false
Dont Destroy On Load #
Type: bool
Description: Determines whether the MPConnection component should be preserved across scene changes.
Default Value: true
Ping Report Interval #
Type: float
Description: The interval at which ping reports are sent.
Default Value: 10f
Start Connected #
Type: bool
Determines whether the connection should be started automatically on scene load or object creation.
Default Value: true
Load Scene On Join Room #
Type: bool
Description: Determines whether the scene should be loaded automatically when joining a room.
Default Value: true
