Potential fix for ship sync

This commit is contained in:
Chris Bell 2024-12-18 22:44:08 -06:00
parent cf3beff3e5
commit 52ed547ab2

View File

@ -71,8 +71,10 @@ func _physics_process(_delta):
angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed) angular_velocity.y = clamp(angular_velocity.y, -max_turn_speed, max_turn_speed)
#if NetworkManager.is_host: global_rotation.x = lerpf(global_rotation.x, 0, 0.1)
global_rotation.z = lerpf(global_rotation.z, 0, 0.1)
if piloting_player == null or !piloting_player.is_network_authority:
if old_global_position_cache != global_position: if old_global_position_cache != global_position:
NetworkManager.sync_property(uuid, "global_position", global_position) NetworkManager.sync_property(uuid, "global_position", global_position)
old_global_position_cache = global_position old_global_position_cache = global_position
@ -81,10 +83,6 @@ func _physics_process(_delta):
NetworkManager.sync_property(uuid, "global_rotation", global_rotation) NetworkManager.sync_property(uuid, "global_rotation", global_rotation)
old_global_rotation_cache = 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)
func _on_area_3d_body_entered(body: Node3D) -> void: func _on_area_3d_body_entered(body: Node3D) -> void:
if body is Player and body.get_parent() != self: if body is Player and body.get_parent() != self: