Skip to content

Commit ecb5827

Browse files
NoelStephensUnitychrispopeLarah Armstrong
authored
update ClientNetworkTransform information (#791)
* update ClientNetworkTransform information This just provides users with a bit more information about setting NetworkTransform into owner/client authoritative mode, * update adjusting the text copy and pointing the example of the ClientNetworkTransform to the co-op samples version * update Applying suggested update for section that outlines how to add the multiplayer samples utilities package to your project. Co-authored-by: Christopher Pope <[email protected]> Co-authored-by: Larah Armstrong <[email protected]>
1 parent e1a8f1d commit ecb5827

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/components/networktransform.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,19 @@ darkImageSrc="/img/BufferedTick_Dark.png?text=DarkMode"/>
5151

5252
`NetworkTransform` always synchronizes positions from the server to the clients and position changes on the clients are not allowed. Netcode for GameObjects comes with a sample containing a `ClientNetworkTransform`. This transform synchronizes the position of the owner client to the server and all other client allowing for client authoritative gameplay.
5353

54-
The `ClientNetworkTransform` lives inside the Multiplayer Samples Utilities package. You can add this package via the `Package Manager` window in the Unity Editor by selecting `add from Git URL` and adding the following URL: `https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main`
54+
You can use the existing ClientNetworkTransform in the Multiplayer Samples Utilities package.<br />
55+
To add the Multiplayer Samples Utilities package:
5556

56-
Or you can directly add this line to your `manifest.json` file:
57+
- Open the Package Manager by selecting Window > Package Manager.
58+
- Select the plus button (+) > Add from git URL....
59+
- Copy and paste the following Git URL: https://github.com/Unity-> Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main
60+
- Select Add.
5761

62+
Optionally, you can directly add this line to your `manifest.json` file:
5863
`"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main"`
64+
65+
You can also create your own `ClientNetworkTransform` by deriving from `NetworkTransform`, overriding the `OnIsServerAuthoritative` virtual method, and returning false:
66+
67+
```csharp reference
68+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/blob/main/Packages/com.unity.multiplayer.samples.coop/Utilities/Net/ClientAuthority/ClientNetworkTransform.cs
69+
```

0 commit comments

Comments
 (0)