void Update() { //Every 0.1 seconds send sync data if (Time.time >= nextSync) { //Create a writer using (DarkRiftWriter writer = new DarkRiftWriter()) { //Get the characters we own SyncCharacter[] ourCharacters = objectSpawner.GetOurs(); writer.Write((ushort)ourCharacters.Length); foreach (SyncCharacter character in ourCharacters) { writer.Write(character.ID); writer.Write(character.transform.position.x); writer.Write(character.transform.position.y); writer.Write(character.transform.position.z); } //Send message HSNetworkManager.Connection.SendMessageToOthers(SYNC_TAG, 0, writer); } nextSync = Time.time + 0.1f; } }