Armed guys!
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user