Home / Godot / G03

Godot error: Animation '%s' doesn't exist. — cause and fix

Godot 4.x runtime/editor script: calling add_frame, set_frame, get_frame_count, remove_fra

ID
G03
Engine
Godot
Verification
原文命中(抓取页面)
Frequency
论坛回复=4(topic 1289 正文命中) / 论坛回复=0(topic 129541 正文命中)

Original message (verbatim)

Animation '%s' doesn't exist.

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

Trigger

Godot 4.x runtime/editor script: calling add_frame, set_frame, get_frame_count, remove_frame, clear, set_animation_speed or similar methods on SpriteFrames with an animation name that has not been created yet.

Typical cause

Each SpriteFrames method cannot find the matching animation iterator E in the animations hash; ERR_FAIL_COND_MSG(!E, ...) returns directly.

Step-by-step fix

  1. Call add_animation(anim) to create the animation first.
  2. Verify the passed string matches the animation name exactly.
  3. Note that when the same SpriteFrames resource is reused by multiple instances, the animation lists are independent.

Source links

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

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