Problem with animation

0 favourites
  • 3 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • First, sorry if I'm posting in a wrong place and if already exists a topic about this. I'm new in the community. And about my english, I'm brazilian, and don't speaks english very well.

    My problem is with animation stuff. I'm doing this sequence of events:

    <img src="http://img841.imageshack.us/img841/3871/myproblem.jpg" border="0" />

    I'm having problem with the Attack animation. When I press and release Z on stand, nothing happens. But when I'm running this works. And when I use the press and hold event, the animation stops in the last frame.

    How do I do to the animation plays just once when I press Z (press and release / press and hold) ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The reason why this isn't working is because of event #3. Currently that event happens every tick that the hero isn't moving regardless of other animations that might be trying to play. So you start the attack animation but it's immediately overridden with the standing animation one tick later (too fast for you to see).

    To fix this all you have to do is add another condition to #3 saying "Hero is playing 'Atacando'" and make it the inverse. That way if the attack animation is playing the standing animation won't override it.

    Now, in order to change the attack animation back when it finishes make another event, specifically "Hero - animations - On Finished" and use that to change the animation back to the standing one.

  • Thank you very much. I did that and worked! Thanks!

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