G04 · Godot
Index p_frame = %d is out of bounds (vframes * hframes = %d).
Trigger: Godot 4.x runtime: Sprite2D.set_frame(n) receives a frame number greater than or equal to vframes*hframes; common after switching texture or sprite sheet without syncing hframes/vframes, or when animation frame data still holds the old sheet's frame count.
Typical cause: Sprite2D::set_frame validates the index with ERR_FAIL_INDEX(p_frame, vframes * hframes); on out-of-bounds, _err_print_index_error assembles this default index message.
- Update hframes and vframes together when switching textures.
- Keep frame below vframes*hframes-1.
- Clear stale old-frame keyframes in the AnimationPlayer or script.
- Reset frame to 0 if needed.
- https://raw.githubusercontent.com/godotengine/godot/master/scene/2d/sprite_2d.cpp#297
- https://raw.githubusercontent.com/godotengine/godot/master/core/error/error_macros.cpp#202
- https://docs.godotengine.org/en/stable/classes/class_sprite2d.html
- https://forum.godotengine.org/t/encountered-an-issue-set-frame-index-p-frame-17-is-out-of-bounds-with-higher-version-when-trying-to-upgrade-godot-from-4-1-1/76993
Per-entry sources and capture date are listed at /sources#G04.
G07 · Godot
Index p_coord.y = %d is out of bounds (vframes = %d).
Trigger: Godot 4.x runtime: the y coordinate passed to Sprite2D.set_frame_coords(Vector2i(x, y)) exceeds vframes (the p_coord.x / hframes version prints when x exceeds hframes); common when switching between two sprite sheets with different row/column counts.
Typical cause: Sprite2D::set_frame_coords runs ERR_FAIL_INDEX checks on p_coord.x and p_coord.y separately; on out-of-bounds it prints the default index message.
- Update hframes and vframes together when switching sprite sheets.
- Keep different state sheets on the same grid row/column count.
- Avoid AnimationPlayer keyframes referencing coordinates that do not exist in the current grid.
- https://raw.githubusercontent.com/godotengine/godot/master/scene/2d/sprite_2d.cpp#314
- https://raw.githubusercontent.com/godotengine/godot/master/core/error/error_macros.cpp#202
- https://docs.godotengine.org/en/stable/classes/class_sprite2d.html
- https://forum.godotengine.org/t/the-problem-with-the-sprite-sheet-animation-set-frame-coords-index-p-coord-y-6-is-out-of-bounds-vframes-5/74552
Per-entry sources and capture date are listed at /sources#G07.
Related 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.