[SOLVED] How do I fix my animation

0 favourites
  • 4 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • I'm trying to make my player do an "attack" animation when it the player clicks an enemy, but for some reason it doesn't do it.

    In my game once the enemies enter your range you can kill them, but the player only makes the animation if I touch them when they're outside.

    In case you guys need it, here is the capx file. dropbox(dot)com/s/afpooslo6qgrno2/Touch%20Kill%20Nuevo%204.5.capx?dl=0

    I really need help on this, I don't know what happened, it used to be fine and suddenly it stopped working.

    Btw, sorry if I have bad grammar, english isn't my main language.

  • I tried having a look at the .capx, but I couldn't play around at all because I'm using the free version of C2. That being said, one possible situation that could be causing it could be a conflicting process between the act of attacking, and the conditions of displaying the animation.

    Using your samurai as the example,

    If the samurai is within the correct range, touching it subtracts 30 hp, instantly destroying it.

    The condition for showing the animation however, is dependent on an enemy being touched,

    So what I think MAY be causing it (and as I'm fairly new I could be totally wrong, but it's a suggestion), is that if Construct processes the top event pictured first, the enemy is destroyed, and as such by the time Construct processes the second event dealing with the animation, the condition of the player touching an enemy (

    ) is no longer true.

    Try lowering the damage dealt to enemies on touch and see if that helps, if what I'm guessing is true, that may fix the issue and show what the problem is.

    I hope I helped somehow, and I hope you manage to clear up your issue!

    Regards,

    Gideon.

    P.S Considering English isn't your first language you were perfectly easy to understand, too.

  • Thanks for your response.

    I tried moving around the order of the events and I fixed it!

    I only needed to put the animations events before the kills events xD!

    Thanks for helping me out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No worries man.

    Regards,

    Gideon

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