How to create a attack animation?

I want to make an attack animation after pressing a key. I do not know how to implement it! Help!

You need to break this down into two steps:

  • Detect when the attack key was pressed
  • Play animation

Detect user input

You can learn about this here: Device input in Defold
And there is an examples of input here: 8 ways movement

Play animation

Again, you can find information about playing animations in the manuals: Flipbook animations in Defold manual
And an example: Flipbook animation

6 Likes