From 82ea695454592f81802ec711c5ec0bd2915ed15a Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Sun, 15 Dec 2024 00:25:38 -0600 Subject: [PATCH] node id --- assets/core/networking/scripts/NetworkManager.gd | 4 ++-- assets/core/player-controller/scripts/player.gd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/core/networking/scripts/NetworkManager.gd b/assets/core/networking/scripts/NetworkManager.gd index 6e79824..91df6f0 100644 --- a/assets/core/networking/scripts/NetworkManager.gd +++ b/assets/core/networking/scripts/NetworkManager.gd @@ -381,8 +381,8 @@ func _on_game_started(): player.is_network_authority = false -func sync_property(node_id: int, property_name: String, value: Variant): - var packet_data = {"message":"property_update", "node_id":node_id, "property_name":property_name, "value":value} +func sync_property(node_id: String, property_name: String, value: Variant): + var packet_data = {"message":"property_update", "node_id": node_id, "property_name":property_name, "value":value} send_p2p_packet(0, packet_data) diff --git a/assets/core/player-controller/scripts/player.gd b/assets/core/player-controller/scripts/player.gd index 88abc79..bac52a5 100644 --- a/assets/core/player-controller/scripts/player.gd +++ b/assets/core/player-controller/scripts/player.gd @@ -85,10 +85,10 @@ func _process(delta: float) -> void: # If the global_position has changed, notify the NetworkManager if previous_global_position != global_position: - NetworkManager.sync_property(get_instance_id(), "global_position", global_position) + NetworkManager.sync_property(network_uuid, "global_position", global_position) previous_global_position = global_position if previous_global_rotation != global_rotation: - NetworkManager.sync_property(get_instance_id(), "global_rotation", global_rotation) + NetworkManager.sync_property(network_uuid, "global_rotation", global_rotation) previous_global_rotation = global_rotation func capture_mouse() -> void: