fix: a lot of network sync fixes
This commit is contained in:
@@ -185,15 +185,13 @@ func _die(_hit_position: Vector3, source: Node, damage_amount: float) -> void:
|
||||
linear_vel = hit_dir * (damage_amount * 0.02)
|
||||
impulse = hit_dir * (damage_amount * 0.5)
|
||||
|
||||
get_tree().create_timer(0.01).timeout.connect(func():
|
||||
if is_instance_valid(ragdoll_instance):
|
||||
# The ragdoll also inherits the current walking velocity natively
|
||||
ragdoll_instance.apply_initial_velocities(velocity + linear_vel, impulse)
|
||||
)
|
||||
get_tree().create_timer(0.01).timeout.connect(_apply_ragdoll_velocity.bind(ragdoll_instance, velocity + linear_vel, impulse))
|
||||
|
||||
get_tree().create_timer(3.0).timeout.connect(func():
|
||||
_respawn()
|
||||
)
|
||||
get_tree().create_timer(3.0).timeout.connect(_respawn)
|
||||
|
||||
func _apply_ragdoll_velocity(ragdoll: Node3D, l_vel: Vector3, imp: Vector3) -> void:
|
||||
if is_instance_valid(ragdoll):
|
||||
ragdoll.apply_initial_velocities(l_vel, imp)
|
||||
|
||||
func _respawn() -> void:
|
||||
if is_instance_valid(ragdoll_instance):
|
||||
|
||||
Reference in New Issue
Block a user