Skip to content

Commit 2921bf3

Browse files
fernando-cortezLarah Armstrong
and
Larah Armstrong
authored
Update ClientDriven.md with updated scripting references (#865)
Co-authored-by: Larah Armstrong <[email protected]>
1 parent 1e33158 commit 2921bf3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/learn/bitesize/bitesize-clientdriven.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,40 @@ Making movements feel responsive while staying consistent over multiple game exe
1717
## Sample:
1818

1919
ClientDriven's aim is to create a quick sample to show responsive character movements that don't feel sluggish, even under bad network conditions.
20-
It uses the ClientNetworkTransform sample and moves your own player's position client side, [client authoritatively](../dealing-with-latency.md#allow-low-impact-client-authority).
20+
It uses the ClientNetworkTransform sample and moves your own player's position client side, [client authoritatively](../dealing-with-latency.md#allow-low-impact-client-authority). Movement is leveraged through the use of Unity's Starter Assets, the [Third Person Character Controller](https://assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-196526).
2121

2222
```csharp reference
23-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/9854697081df4962dd525d7c3bd65f9f88c7ee60/Basic/ClientDriven/Assets/Scripts/ClientPlayerMove.cs#L57-L64
23+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/StarterAssets/ThirdPersonController/Scripts/ThirdPersonController.cs#L274-L276
2424
```
2525

2626
### Client side object detection for pickup with server side pickup validation
2727
Ingredients in ClientDriven are owned by the server, since they are [shared objects](../dealing-with-latency.md#issue-world-consistency). This means if a player tries to grab an object while that object is moving, a server side range detection would sometimes fail, even though it should have succeeded (since ingredients are replicated with some lag, so the player would try to grab ingredients that are a few milliseconds behind).
2828
To make sure this doesn't happen, the object detection done to grab an ingredient is also done client side.
2929

3030
```csharp reference
31-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/develop/Basic/ClientDriven/Assets/Scripts/ClientPlayerMove.cs#L66-L94
31+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/Scripts/ClientPlayerMove.cs#L64-L94
3232
```
3333

3434
But the pickup itself is done server side.
3535

3636
```csharp reference
37-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/996ac9785c4e825c0e4692f115c9b5f2b4c7c386/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L41-L69
37+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L46-L82
3838
```
3939

4040
Notice how we're checking whether that object can be picked up or not (since another player could have picked it up at the same time, creating a conflict).
4141

4242
```csharp reference
43-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/996ac9785c4e825c0e4692f115c9b5f2b4c7c386/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L45
43+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L50
4444
```
45-
If the object is already picked up, we're not doing anything. You client side animations should take this into account and cancel any animations "carrying" something.
45+
If the object is already picked up, we're not doing anything. Your client side animations should take this into account and cancel any animations "carrying" something.
4646

4747
### Server side player spawn points
4848
In this sample, our spawn points list is server side (to have a single source of truth).
4949
ClientNetworkTransforms can be updated by owners only, which means the server can't update the player's position directly.
5050
This means OnNetworkSpawn, the server will need to assign a position to the player using a ClientRPC.
5151

5252
```csharp reference
53-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/0c9081b27e66879ce5742314c13ff69ac45ff02e/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L24-L37
53+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L24-L44
5454
```
5555

5656
## Server physics with client driven movements (interactions on different timelines)
@@ -64,5 +64,5 @@ Note that we're also setting InLocalSpace while reparenting, to make sure the cl
6464
An ownership change could also have been used here, but the client would have needed to ask the server for that change first.
6565

6666
```csharp reference
67-
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/0c9081b27e66879ce5742314c13ff69ac45ff02e/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L42-L54
67+
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/blob/d37c360bc8cdbbbf680e2afc5963571e20f28ffd/Basic/ClientDriven/Assets/Scripts/ServerPlayerMove.cs#L46-L61
6868
```

0 commit comments

Comments
 (0)