From 51dc6406a8d2e28e4f8e292f237309eb43e87e80 Mon Sep 17 00:00:00 2001 From: Gary Steven K Date: Mon, 16 Dec 2024 21:57:38 -0500 Subject: [PATCH] revert properly to is host check --- assets/core/ships/ship_script.gd | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/assets/core/ships/ship_script.gd b/assets/core/ships/ship_script.gd index 34891eb..525ba9e 100644 --- a/assets/core/ships/ship_script.gd +++ b/assets/core/ships/ship_script.gd @@ -71,20 +71,19 @@ func _physics_process(_delta): angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed) + #if NetworkManager.is_host: + + if old_global_position_cache != global_position: + NetworkManager.sync_property(uuid, "global_position", global_position) + old_global_position_cache = global_position + + if old_global_rotation_cache != global_rotation: + NetworkManager.sync_property(uuid, "global_rotation", global_rotation) + old_global_rotation_cache = global_rotation + # Self level slowly if host global_rotation.x = lerpf(global_rotation.x, 0, 0.1) global_rotation.z = lerpf(global_rotation.z, 0, 0.1) - - #if NetworkManager.is_host: - - if old_global_position_cache != global_position: - NetworkManager.sync_property(uuid, "global_position", global_position) - old_global_position_cache = global_position - - if old_global_rotation_cache != global_rotation: - NetworkManager.sync_property(uuid, "global_rotation", global_rotation) - old_global_rotation_cache = global_rotation - func _on_area_3d_body_entered(body: Node3D) -> void: