Attack animation

added auto fill buttons on the menu
This commit is contained in:
Twirpytherobot
2025-11-12 19:51:47 +00:00
parent bc30cfd6ca
commit c077bd37a7
7 changed files with 96 additions and 24 deletions
+11
View File
@@ -14,6 +14,10 @@ func apply_rotation(_velocity: Vector3) -> void:
# rpc("sync_player_rotation", new_rotation_y)
func animate(_velocity: Vector3) -> void:
# Don't override attack animation if it's playing
if animation_player.is_playing() and animation_player.current_animation == "Attack1":
return
if not _character.is_on_floor():
if _velocity.y < 0:
animation_player.play("Fall")
@@ -31,6 +35,13 @@ func animate(_velocity: Vector3) -> void:
animation_player.play("Idle")
func play_attack() -> void:
if animation_player:
# Play attack animation once (don't loop)
animation_player.play("Attack1", -1, 1.0)
# Ensure it doesn't loop
animation_player.animation_set_next("Attack1", "")
# @rpc("any_peer", "reliable")
# func sync_player_rotation(rotation_y: float) -> void:
# rotation.y = rotation_y