[Help]Plataform games:attacking

0 favourites
  • 3 posts
  • Hey guys,

    can you help me out?I want my plataform's main character to attack when i press the button,but he just starts to attack and he doesn't finish the animation,how can i finish my attack animation without having to keep pressing the button?

    EDIT:Oh yea...the attack has to be a meelee attack,like,slashing with a sword or punching,not like a gun.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If the problem is what I think it is, you should use what they call a state machine. Have a private variable for that character called "State", and use it to control animations. Like this:

    On button pressed

    Set State to "attack"

    On "attackAnimation" finished

    Set State to "stand"

    If State = "attack"

    Set animation to "attackAnimation"

    If State = "stand"

    Set animation to "stand"

    See what I mean? It's really handy for controlling things, especially when you have more and more animations to cycle through.

  • Hey,Thanks

    that's really useful

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)