Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit be7e8c9

Browse files
fix bug where positions were not being updated for other clients
1 parent 1acba6f commit be7e8c9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Scripts/Scenes/Game/SceneGame.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ public static void UpdatePlayerPositions(Dictionary<uint, Vector2> playerPositio
5858
foreach (var pair in playerPositions)
5959
{
6060
var player = Instance.Players[pair.Key];
61-
player.Position = pair.Value;
61+
62+
if (pair.Key == GameClient.PeerId)
63+
{
64+
if (player.Position.DistanceSquaredTo(pair.Value) > 250)
65+
player.Position = pair.Value;
66+
}
67+
else
68+
player.Position = pair.Value;
6269
}
6370
}
6471

0 commit comments

Comments
 (0)