Home / Godot / G01

Godot error: There is no animation with name '%s'. — cause and fix

Godot 4.x runtime: a script calls AnimatedSprite2D.play("walk") or set_animation("walk"),

ID
G01
Engine
Godot
Verification
原文命中(抓取页面)
Frequency
论坛回复=21(topic 59085 标题命中) / 论坛回复=4(topic 1289 正文命中) / 论坛回复=0(topic 143325 正文命中)

Original message (verbatim)

There is no animation with name '%s'.

Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.

Trigger

Godot 4.x runtime: a script calls AnimatedSprite2D.play("walk") or set_animation("walk"), but the animation name does not exist in this node's SpriteFrames, or the SpriteFrames resource itself is unassigned; common when instantiating an external scene or the autoplay name does not match a defined animation.

Typical cause

AnimatedSprite2D::play / set_animation first checks whether frames are empty or get_animation_names().has(name) is false; ERR_FAIL_COND_MSG aborts directly and prints this message.

Step-by-step fix

  1. Check the SpriteFrames animation name spelling and leading/trailing spaces.
  2. Confirm a SpriteFrames is assigned in the node's Inspector.
  3. Call play only after the scene instance is ready.
  4. Keep the autoplay property name consistent with the name in the animation list.

Source links

Per-entry sources and capture date are listed at /sources#G01.

Related errors

Related Godot errors

Need an offline quick-reference checklist?

Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.

View Pro pack / order

Back to the all-errors index Checkout and buy the Pro pack — $19.00