Home / Godot / G11

Godot error: Animation speed cannot be negative (%d). — cause and fix

Godot 4.x runtime/editor script: SpriteFrames.set_animation_speed receives a negative fps

ID
G11
Engine
Godot
Verification
源码原文(路径)
Frequency
未公开

Original message (verbatim)

Animation speed cannot be negative (%d).

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: SpriteFrames.set_animation_speed receives a negative fps value.

Typical cause

set_animation_speed first validates p_fps < 0; ERR_FAIL_COND_MSG rejects the negative value before looking up the animation.

Step-by-step fix

  1. Pass an fps >= 0.
  2. For reverse playback, use a negative AnimatedSprite2D speed_scale instead of setting animation fps to negative.

Source links

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

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