Skip to content

Commit 3335f15

Browse files
update: SinglePlayerTransport clarification on usage (#1482)
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
1 parent c4c9fff commit 3335f15

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/advanced-topics/transports.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Netcode's default transport Unity Transport is an entire transport layer that yo
2424

2525
## `SinglePlayerTransport`
2626

27-
Netcode for GameObjects provides a `SinglePlayerTransport` that you can use to create a local single player network session. This simplifies switching between multiplayer and single player sessions within the same project, while still being able to use existing netcode scripts. The `SinglePlayerTransport` is a effectively a mock transport that ensures full `NetworkTransport` functionality without any transport dependencies.
27+
Netcode for GameObjects provides a `SinglePlayerTransport` that you can use to create a local single player network session. This simplifies switching between multiplayer and single player sessions within the same project, while still being able to use existing netcode scripts. The `SinglePlayerTransport` is a effectively a mock transport that ensures full `NetworkTransport` functionality without any transport dependencies. The `SinglePlayerTransport` is unique in that it **requires that you** only start as a host. This is because in reality you are starting a local server and a local client which will still run as if it was a network session but it never actually opens any network ports or communicates outside of the local system.
2828

2929
### Set up a single player session
3030

@@ -75,7 +75,11 @@ public class ExtendedNetworkManager : NetworkManager
7575
}
7676
```
7777

78-
As shown in the script above, when starting a single player session the `SinglePlayerTransport` is assigned to the `NetworkConfig.NetworkTransport`, and when starting a hosted multiplayer session the `UnityTransport` is assigned.
78+
As shown in the script above, when starting a single player session the `SinglePlayerTransport` is assigned to the `NetworkConfig.NetworkTransport`, and when starting a hosted multiplayer session the `UnityTransport` is assigned.
79+
80+
:::info
81+
In order to use `SinglePlayerTransport` you must set the `NetworkConfig.NetworkTransport` to the `SinglePlayerTransport` component and you must start a local single player session using `NetworkManager.StartHost`.
82+
:::
7983

8084
### Single player limitations
8185

0 commit comments

Comments
 (0)