Merge remote-tracking branch 'origin/feature/ship-syncing' into feature/ship-syncing
This commit is contained in:
commit
d225145927
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user