Skip to content

Commit 53036b1

Browse files
committed
CharacterSpriteBehavior: Fallback to idle when walk is not available
1 parent 52ecf78 commit 53036b1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scenes/game_logic/sprite_behaviors/character_sprite_behavior.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ func _process_animations(_delta: float) -> void:
5656
sprite.play(&"run")
5757
else:
5858
sprite.speed_scale = 2.0
59-
sprite.play(&"walk")
59+
sprite.play(&"walk" if sprite.sprite_frames.has_animation(&"walk") else &"idle")
6060
else:
6161
sprite.speed_scale = 1.0
62-
sprite.play(&"walk")
62+
sprite.play(&"walk" if sprite.sprite_frames.has_animation(&"walk") else &"idle")
6363

6464

6565
func _notification(what: int) -> void:

0 commit comments

Comments
 (0)