Testing
Multipeer Mode
Multipeer mode is great for quickly testing networking functionality with multiple players within a single Unity Editor instance.
To start the game in multipeer mode, first check that the Peer Mode
in the NetworkProjectConfig
asset is set to Multiple
. Open any gameplay scene (for example Game
), locate the StandaloneManager
object, and set ExtraPeers
count to 2. From now on, when playing the scene it will automatically start with two extra peers.
To switch between peers, press the 1, 2, and 3 keys on the numpad. To see all the instances of the player (from different peers) simultaneously, press 4, 5, and 6 keys on the numpad.
Public Build
To easily control playtests with the community, some functionality is hidden/disallowed in the public build (creating a game, triggering drop sequence in battle royale mode).
A public build is any build which contains -public
in PhotonAppSettings
=> App Version
(for example '1.0-public'). Moderators can bypass this limitation by launching the game with the -moderator
command line argument. That way only a single build needs to be created for everyone.
Be aware that this solution uses security by obscurity and must be removed from the code at some point.
Back to top