Home / Phaser / P12

Phaser error: 'AnimationManager key already exists: ' + key — cause and fix

Calling this.anims.create({ key: ... }) repeatedly; the animation key is already registere

ID
P12
Engine
Phaser
Verification
源码原文(src/animations/AnimationManager.js:539)
Frequency
未公开

Original message (verbatim)

'AnimationManager key already exists: ' + key

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

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.

Source links

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

Related errors

Related Phaser 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