- NetworkRunner Visibility
Multi-Peer mode allows Fusion to instantiate multiple completely independent game instances with their own associated Fusion Simulation, Physics scene, Network Connection, and Scenes inside of a single Unity Editor instance.
Multi-peer mode can be enabled by selecting
Fusion > NetworkProjectConfig from the top Unity Editor menu, and then setting
Peer Mode to
The ability to run multiple peers (
NetworkRunners) in one Unity instance allows for:
- testing multiple clients in the editor, without needing to make multiple builds or run additional Unity editor instances.
- dedicated servers which can serve multiple Game Sessions from a single Unity instance.
- clients which can connect to multiple Game Sessions simultaneously.
NetworkRunner visibility is only applicable to Multi-Peer mode. By default all peers are visible. When scenes are loaded or objects are spawned, they are registered with the
NetworkRunner's visibility system which automatically finds renderers, audio sources and any other components that constitute visibility to a given peer.
When running in Multi-Peer mode,
NetworkRunner.IsVisible will enable and disable all registered rendering/audio components. This allows to hide and show runners, without affecting code execution.
Visibility can be controlled via code by setting the
Runner Visibility Controls
Runner Visibility Controls window provides tools for showing/hiding runners, as well as controlling which runners are collect user input. There are also quick-access buttons for creating a new
FusionStats overlay for any active runner.
Selecting the button with the Runner’s name will ping the associated runner in the scene.
This window can be opened with the
Fusion > Windows > Runner Visibility Controls menu.
NetworkRunner name listed may be selected, which will ping/select that
NetworkRunner instance in the scene.
NetworkRunner.PlayerRef.PlayerId is displayed next to the
NetworkRunner name. If a
PlayerObject has been assigned to the
NetworkRunner, clicking this will ping/select that player GameObject in the scene.
This component automatically adds a
RunnerVisibilityNode component for each component listed in the
Components field. These indicated components will be limited to no more than one enabled instance when running in Multi-Peer mode. This is particularly important for components which Unity intends to be singletons, such as
Selects which Runner peer type should be prioritized as the visible when multiple
NetworkRunners are active.
The components currently flagged as single instance only. Any components here will be disabled on all but one peer.