Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'duration') #6441

@liuzhongq

Description

@liuzhongq
    this.sprite = this.add.sprite(400, 300, 'boom');
    let frameNames = this.anims.generateFrameNames('boom', {
        prefix: 'boom_',
        start: 0,
        end: 9,
        zeroPad: 2,
        suffix: '.png'
    });

    this.anims.create({
        key: 'animationKey',
        frames: frameNames,
        frameRate: 10,
        repeat: -1
    });
    this.sprite.anims.play('animationKey');

phaser.js:39460 Uncaught TypeError: Cannot read properties of undefined (reading 'duration')
at Animation.getFirstTick (phaser.js:39460:1)
at AnimationState.startAnimation (phaser.js:37181:1)
at AnimationState.play (phaser.js:37081:1)
at Project.create (game.js:139:1)
at SceneManager.create (phaser.js:84684:1)
at SceneManager.bootScene (phaser.js:84600:1)
at SceneManager.start (phaser.js:85129:1)
at SceneManager.processQueue (phaser.js:84439:1)
at SceneManager.update (phaser.js:84639:1)
at Game.step (phaser.js:137314:1)
at TimeStep.step (phaser.js:75507:1)
at step (phaser.js:75715:1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions