node id
This commit is contained in:
parent
8b6dd0d927
commit
82ea695454
@ -381,7 +381,7 @@ func _on_game_started():
|
||||
player.is_network_authority = false
|
||||
|
||||
|
||||
func sync_property(node_id: int, property_name: String, value: Variant):
|
||||
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)
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user