From 80165ca131cd3d03bdb070300e73b43192e65367 Mon Sep 17 00:00:00 2001 From: Gary Steven K Date: Sat, 28 Dec 2024 20:15:40 -0500 Subject: [PATCH] minor player script fixes --- assets/core/ships/test-ship/test_ship.gd | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/assets/core/ships/test-ship/test_ship.gd b/assets/core/ships/test-ship/test_ship.gd index 1e32b27..4bd521c 100644 --- a/assets/core/ships/test-ship/test_ship.gd +++ b/assets/core/ships/test-ship/test_ship.gd @@ -7,6 +7,7 @@ extends RigidBody3D var ship_id: int = 0 var ship_is_piloted: bool = false var base_turn_speed: float = 1 +var top_turn_speed: float = 50.0 var ship_lift_speed: float = 20 # Adjust this value as needed var acceleration: float = 50 var deceleration: float = acceleration * 0.5 @@ -25,11 +26,11 @@ func _ready(): func _physics_process(delta): - global_rotation.x = lerpf(global_rotation.x, 0, 0.01) - global_rotation.z = lerpf(global_rotation.z, 0, 0.01) + global_rotation.x = lerpf(global_rotation.x, 0, 0.5) + global_rotation.z = lerpf(global_rotation.z, 0, 0.5) if ship_is_piloted: - var turn_speed = base_turn_speed / max(mass, 1) + var turn_speed = base_turn_speed / max(mass, 1) # changes speeds based on how THICC the ship is if Input.is_action_pressed("move_left"): angular_velocity.y += turn_speed elif Input.is_action_pressed("move_right"): @@ -52,11 +53,7 @@ func _physics_process(delta): if Input.is_action_pressed("crouch"): apply_impulse(Vector3.DOWN * ship_lift_speed) - angular_velocity.y = clamp(angular_velocity.y, -0.5, 0.5) - - if piloting_player != null and ship_helm.is_being_piloted: - piloting_player.global_position = ship_helm.helm_lock_pos.global_position - + angular_velocity.y = clamp(angular_velocity.y, -top_turn_speed, top_turn_speed) func _on_area_3d_body_entered(body):