Silent jump and fall damage

This commit is contained in:
Rendo 2025-12-14 20:56:39 +05:00
commit c04a29b9c4
3 changed files with 7421 additions and 7404 deletions

View file

@ -11,6 +11,7 @@ class_name Player
$Camera3D.set_multiplayer_authority(id)
var passived: bool = false
var previous_velocity: Vector3
signal health_changed(to: int)
signal damaged
@ -43,7 +44,7 @@ func _ready() -> void:
func _physics_process(_delta: float) -> void:
if not multiplayer.is_server():
return
previous_velocity = velocity
move_and_slide()
func die() -> void:
@ -68,6 +69,8 @@ func depassive() -> void:
passived = false
func take_damage(damage: int):
if damage == 0:
return
if dead:
return
hp -= damage