player sync

This commit is contained in:
brausjonas
2022-05-13 14:21:30 +02:00
parent 4e625ea185
commit 1fe20dbb5d
4 changed files with 79 additions and 2 deletions
@@ -52,6 +52,15 @@ public class World : MonoBehaviour
}
}
public void UpdatePlayerPosition(Vector3 position, byte id)
{
otherPlayers.TryGetValue(id, out GameObject g);
if(g != null)
{
g.transform.position = position;
}
}
public void AddPlayer(byte id)
{
playersToCreate.Enqueue(id);