Home / Merged error reference / 83

Three animation frame errors: Texture not found / Frame not found / AnimationManager key already exists

Covers IDs: P05, P06, P12 · Engine: Phaser

P05 · Phaser

Texture "%s" not found
Verification
源码原文(src/animations/AnimationManager.js:646,752; src/animations/Animation.js:413,458)
Frequency
未公开

Trigger: anims.generateFrameNames/generateFrameNumbers, or the animation config frames, reference a texture key that was never loaded: misspelled key, preload not executed, or the corresponding asset failed to load.

Typical cause: AnimationManager and Animation.getFrames first check textureManager.exists(key); if absent they return an empty frame array and warn.

Step-by-step fix:
  1. Confirm this.load.atlas/spritesheet/image ran successfully in preload.
  2. Check the referenced key matches the registered key.
  3. Create the animation only in the create phase after loading completes.

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

P06 · Phaser

Frame "%s" not found in texture "%s"
Verification
源码原文(src/animations/AnimationManager.js:687,792)
Frequency
未公开

Trigger: A frame name or frame index generated by generateFrameNames/generateFrameNumbers does not exist in the target texture — for example start/end exceeds the actual frame count, or frame name prefix/suffix does not match.

Typical cause: Each frame is validated with texture.has(frame); missing frames are skipped and warned, so the final animation has fewer frames than expected.

Step-by-step fix:
  1. Print texture.getFrameNames() to check available frames.
  2. Adjust start/end or the frames array range.
  3. Use generateFrameNames for atlases and generateFrameNumbers for sprite sheets.

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

P12 · Phaser

'AnimationManager key already exists: ' + key
Verification
源码原文(src/animations/AnimationManager.js:539)
Frequency
未公开

Trigger: Calling this.anims.create({ key: ... }) repeatedly; the animation key is already registered in the global AnimationManager — for example the scene restarted but the animation was not cleaned up.

Typical cause: Inside create, this.get(key) hits the existing animation instance and does not overwrite it; it warns and returns the old instance, so the new config does not take effect.

Step-by-step fix:
  1. Check this.anims.exists(key) before creating.
  2. To rebuild, call this.anims.remove(key) first or this.anims.clear().
  3. Note animations are global and are not destroyed automatically with the scene.

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

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.

View Pro pack / order