peteblank Posted April 14, 2020 Share Posted April 14, 2020 Okay sorry for making another thread. I looked up the manual and examples this time around. For the keyboard event I have it set to JustDown instead of isDown. Which means the the key is registered as being pressed just once. The problem is that when the animation plays, it just plays one frame instead of the whole animation. Please help, I'm close to completing my game.? Link to comment Share on other sites More sharing options...
bauc Posted April 14, 2020 Share Posted April 14, 2020 How is your animation set up? Can you post a snippet of that code? If you are using keyboard JustDown then it should trigger only once otherwise if you are still using isDown then you can use a this.sprite.play('animationName', true); //where true will ignore if already playing rather than restart each time it's called Link to comment Share on other sites More sharing options...
supertommy Posted April 16, 2020 Share Posted April 16, 2020 Can you share what your code looks like? There could be many reasons why you are seeing this problem. Link to comment Share on other sites More sharing options...
peteblank Posted April 17, 2020 Author Share Posted April 17, 2020 18 hours ago, supertommy said: Can you share what your code looks like? There could be many reasons why you are seeing this problem. Sure in the create event I use this.anims.create({ key: "punch", frames: this.anims.generateFrameNumbers("punch", { start: 0, end: 7 }), frameRate: 15, repeat: -1, }); and in the update event I use else if (Phaser.Input.Keyboard.JustDown(shift)) { console.log("pressed down key"); player.setVelocityX(0); player.anims.play("punch"); punching = true; } Link to comment Share on other sites More sharing options...
peteblank Posted May 1, 2020 Author Share Posted May 1, 2020 bump Link to comment Share on other sites More sharing options...
Recommended Posts