fix: a lot of network sync fixes
This commit is contained in:
+10
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user