Armed guys!

This commit is contained in:
Twirpytherobot
2026-02-17 22:21:17 +00:00
parent fce4c4a3e2
commit 7629342540
14 changed files with 928 additions and 73 deletions
+14 -4
View File
@@ -19,13 +19,16 @@ func animate(_velocity: Vector3) -> void:
if animation_player.is_playing() and animation_player.current_animation.begins_with("Attack"):
return
# Check if we're dashing
if _character._is_dashing:
# Check if we're dashing (defensive check for enemies that don't have this)
if _character and "_is_dashing" in _character and _character._is_dashing:
if animation_player.current_animation != "Jump":
_play_animation("Jump")
return
if not _character.is_on_floor():
# Check if on floor (works for any CharacterBody3D)
var on_floor = _character.is_on_floor() if _character else true
if not on_floor:
if _velocity.y < 0:
# Falling - use FallIdle animation
_play_animation("FallIdle")
@@ -34,7 +37,14 @@ func animate(_velocity: Vector3) -> void:
return
if _velocity:
if _character.is_running() and _character.is_on_floor():
# Check if running (defensive check - enemies don't have is_running)
var is_running_val = false
if _character and _character.has_method("is_running"):
is_running_val = _character.is_running() and on_floor
elif _velocity.length() > 5.0: # Fallback: high speed = running
is_running_val = on_floor
if is_running_val:
# Sprint animation = Run for Lilguy
_play_animation("Run")
return