mauro98 Posted June 26, 2018 Share Posted June 26, 2018 Say I have a sequence of 100 png images (523x482 each frame). I'm thinking on creating groups of 9 images in a spritesheet or atlas. But is it possible to create an animation from separate spritesheets/atlas? // frame00 and frame01 are spritesheets with 9 frames. const anim = this.game.add.sprite(265, 70, 'frame_00', 0, scene); anim.animations.add('anim', ['frame_01']); // it does not work anim.animations.play('anim', 30, true); Got the following error: phaser.min.js:3 Uncaught TypeError: Cannot read property 'index' of undefined at i.Animation.updateCurrentFrame (phaser.min.js:3) at i.Animation.play (phaser.min.js:3) at i.AnimationManager.play (phaser.min.js:3) How can I create an animation from this sequence or what would be the best approach to follow? Link to comment Share on other sites More sharing options...
saabale Posted July 5, 2018 Share Posted July 5, 2018 do you still need help? Link to comment Share on other sites More sharing options...
Marcobarroso Posted August 4, 2018 Share Posted August 4, 2018 Hi, I usually work with a mapping object. Example: this.animations = { 'up': [3, 2, 1, 0], 'Down': [0, 1, 2, 3] } let anim = this.game.add.sprite(x, y, 'sprite'); anim.animations.add('up', this.animations.up); anim.animations.play(); Hope this helps. BR Marco Barroso Link to comment Share on other sites More sharing options...
Recommended Posts