fix: a lot of network sync fixes

This commit is contained in:
DottsGit
2026-06-06 20:45:10 -04:00
parent dbbfbef4a4
commit 07a15fe998
8 changed files with 179 additions and 91 deletions
+10 -1
View File
@@ -188,7 +188,16 @@ func _spawn_custom_projectile(origin: Vector3, fire_dir: Vector3) -> void:
if player:
proj.velocity += fire_dir * max(0.0, player.velocity.dot(fire_dir))
proj.initial_aim_dir = _current_aim_dir
var aim_dir = _current_aim_dir
# If remote player, use the synced head rotation to determine forward direction
if player and not player.is_multiplayer_authority():
var head = player.get_node_or_null("HeadPivot")
if head:
aim_dir = -head.global_transform.basis.z.normalized()
else:
aim_dir = fire_dir # Fallback
proj.initial_aim_dir = aim_dir
proj.cruise_speed = 65.0
proj.ignition_timer = randf_range(0.3, 0.6) # Staggered ignition