From 72cf4c0ff107d514f89cd360f12efeddde8b506a Mon Sep 17 00:00:00 2001 From: Gary Steven K Date: Mon, 16 Dec 2024 21:40:36 -0500 Subject: [PATCH] save changes --- assets/core/ships/ship_script.gd | 20 ++++++++++--------- .../ships/shuttle-class/shuttle-class.tscn | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/assets/core/ships/ship_script.gd b/assets/core/ships/ship_script.gd index e47f068..65f5b75 100644 --- a/assets/core/ships/ship_script.gd +++ b/assets/core/ships/ship_script.gd @@ -21,7 +21,7 @@ var old_global_position_cache: Vector3 @export_range(0.01, 1.0, 0.01) var base_turn_speed: float = 0.35 @export var max_turn_speed: float = 0.5 -@export_range(0.01, 1.0, 0.01) var base_lift_speed: float = 2.0 +@export_range(0.01, 10.0, 0.01) var base_lift_speed: float = 2.0 @export var top_speed: float = 5.0 @export var move_speed: float = 1.0 @export var acceleration: float = 0.1 @@ -71,17 +71,19 @@ func _physics_process(_delta): angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed) - # Self level slowly + if NetworkManager.is_host: + # 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 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 + 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: diff --git a/assets/core/ships/shuttle-class/shuttle-class.tscn b/assets/core/ships/shuttle-class/shuttle-class.tscn index 138be02..4312026 100644 --- a/assets/core/ships/shuttle-class/shuttle-class.tscn +++ b/assets/core/ships/shuttle-class/shuttle-class.tscn @@ -24,6 +24,8 @@ gravity_scale = 0.0 script = ExtResource("1_ghft7") player_detection_area = NodePath("PlayerDetectionArea") helm_location_marker = NodePath("HelmLocationMarker") +base_lift_speed = 5.0 +top_speed = 50.0 [node name="ShipToShipCol" type="CollisionShape3D" parent="."] shape = SubResource("BoxShape3D_6gbwt")