diff --git a/addons/godotsteam/win64/~libgodotsteam.windows.template_debug.x86_64.dll b/addons/godotsteam/win64/~libgodotsteam.windows.template_debug.x86_64.dll deleted file mode 100644 index c80cff6..0000000 Binary files a/addons/godotsteam/win64/~libgodotsteam.windows.template_debug.x86_64.dll and /dev/null differ diff --git a/assets/core/ships/ship_script.gd b/assets/core/ships/ship_script.gd index 525c358..def260e 100644 --- a/assets/core/ships/ship_script.gd +++ b/assets/core/ships/ship_script.gd @@ -16,6 +16,8 @@ var current_level var uuid: String = "" +var old_global_trans_cache: Transform3D + @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 @@ -39,41 +41,41 @@ func _ready(): func _physics_process(_delta): - if ship_is_piloted: - var turn_speed = base_turn_speed / max(mass, 1) - var lift_speed = base_lift_speed / max(mass, 1) + if piloting_player.is_network_authority: + if ship_is_piloted: + var turn_speed = base_turn_speed / max(mass, 1) + var lift_speed = base_lift_speed / max(mass, 1) + + if Input.is_action_pressed("move_left"): + angular_velocity.y += turn_speed + elif Input.is_action_pressed("move_right"): + angular_velocity.y -= turn_speed + else: + global_rotation.z = lerpf(global_rotation.z, 0, 0.8) + + if Input.is_action_pressed("jump"): + linear_velocity.y += lift_speed + elif Input.is_action_pressed("crouch"): + linear_velocity.y -= lift_speed + + var target_velocity = Vector3.ZERO + if Input.is_action_pressed("move_forwards"): + target_velocity = -transform.basis.z * top_speed + elif Input.is_action_pressed("move_backwards"): + target_velocity = transform.basis.z * top_speed + var current_acceleration = (target_velocity - linear_velocity) * acceleration + apply_central_force(current_acceleration * mass) + if linear_velocity.length() > top_speed: + linear_velocity = linear_velocity.normalized() * top_speed + + angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed) - if Input.is_action_pressed("move_left"): - angular_velocity.y += turn_speed - elif Input.is_action_pressed("move_right"): - angular_velocity.y -= turn_speed - else: - global_rotation.z = lerpf(global_rotation.z, 0, 0.8) + # Self level slowly + global_rotation.x = lerpf(global_rotation.x, 0, 0.1) + global_rotation.z = lerpf(global_rotation.z, 0, 0.1) - if Input.is_action_pressed("jump"): - linear_velocity.y += lift_speed - elif Input.is_action_pressed("crouch"): - linear_velocity.y -= lift_speed - - var target_velocity = Vector3.ZERO - if Input.is_action_pressed("move_forwards"): - target_velocity = -transform.basis.z * top_speed - elif Input.is_action_pressed("move_backwards"): - target_velocity = transform.basis.z * top_speed - var current_acceleration = (target_velocity - linear_velocity) * acceleration - apply_central_force(current_acceleration * mass) - if linear_velocity.length() > top_speed: - linear_velocity = linear_velocity.normalized() * top_speed - - angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed) - - # Self level slowly - global_rotation.x = lerpf(global_rotation.x, 0, 0.1) - global_rotation.z = lerpf(global_rotation.z, 0, 0.1) - - # Networking - NetworkManager.sync_property(uuid, "global_position", global_position) - NetworkManager.sync_property(uuid, "global_rotation", global_rotation) + # Networking + NetworkManager.sync_property(uuid, "global_transform", global_transform) func _on_area_3d_body_entered(body: Node3D) -> void: diff --git a/godot-jolt/windows/~godot-jolt_windows-x64_editor.dll b/godot-jolt/windows/~godot-jolt_windows-x64_editor.dll deleted file mode 100644 index c05d288..0000000 Binary files a/godot-jolt/windows/~godot-jolt_windows-x64_editor.dll and /dev/null differ