v33dub Posted April 25, 2018 Share Posted April 25, 2018 Hey guys, hoping you can help me with this. My attack animation is only playing the first frame. Here's where I pull in the frames: var swordDown = player.animations.add('swordDown', Phaser.Animation.generateFrameNames('swordDown', 1, 4), 10, true); And here's where I try to play the animation in the update loop: // Player attack functionality if(spaceKey.isDown) { if(spaceKey.justPressed) { player.animations.play('swordDown'); } } The frames will play just fine if I set the isDown to one of the cursor keys, so I know my frames are coming in right. Any ideas? This is driving me batty. Link to comment Share on other sites More sharing options...
v33dub Posted April 30, 2018 Author Share Posted April 30, 2018 Anyone have any info on this, or a way that I can write it better? I'm open to trying something totally new, just as long as I can get the animation to play when I press a button. Link to comment Share on other sites More sharing options...
v33dub Posted April 30, 2018 Author Share Posted April 30, 2018 player.animations.play('swordDown', 10, true); Figured it out. For anyone stuck on this, I had to add the framerate to the play call ^^^ Link to comment Share on other sites More sharing options...
Recommended Posts