This commit is contained in:
Chris Bell 2024-12-15 00:25:38 -06:00
parent 8b6dd0d927
commit 82ea695454
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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: