0 Favourites

Idle animation ruining attack animation

  • Okay, so I set up an enemy to attack when I get close, and it worked. I thought I would try to give him an idle animation, but no matter what I do, the idle animation nullifies the attack animation.

    Here is a screen shot. Note that I also just got Spriter, so I'm trying this with both a regular sprite enemy, and the new spriter object.

    Enemy (red) and the myfirstattack Spriter thing are two different things. I'm trying to animate them both. Though I will remove the enemy once I get Spriter working. I have been using "enemy" to figure out a.i. and just got Spriter yesterday, so I'm still working on it.

    That's just the part that I need help with. The full event sheet is too big to show, but it worked fine before. I just can't get it to work with an idle animation and an "attack on contact" animation. The enemy is set to attack when I touch it. It only works if I disable the idle animation.

    I set the idle animation to play when the enemy is standing still. It plays the idle animation with the enemy.

    With the idle animation enabled, the Spriter guy just stands there. If I remove the idle animation from the Spriter guy, he attacks non stop.

    Obviously, there is something I am missing. Surely, it's something simple.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Also, why is this forum so buggy? I have been denied making simple posts like "thanks for the help" in other threads because I didn't have "permission", and now I can't add the following line to my post above "oh, and both are pinned to a hitbox with platformer enabled." because all the sudden it says I can't post links or something. There are no links in my edit, so I'll just make a whole new post to say what would have taken one line. *sigh*

    Anyway, thanks for the help to anyone who answers my question above.

  • I think your conditions might be wrong.

    When the "animatehitbox" collide with "playerhitbox" it start the attack animation. which seems fine.

    However your Idle animation is started if "animatehitbox" at anytime is not moving and are on the floor. I don't know what you game is about. But would assume that "animatehitbox" spends most if not all time on the floor?

    So if it at any point stand still it will trigger the idle animation, so could be that as it collide with "playerhitbox" it stops to do an attack and therefore triggers the idle animation.

    To solve it, you could add a boolean variable to "animatehitbox" called "In_combat" or something. And in the collide "on hit event" set it to true.

    And in the "idle trigger event" you add another condition that it will only be true, if "In_combat = false"

    Also think it could be a good idea to use "continue from frame" or what its called for your idle animation, other wise you might get jumpy animations as you can be sure which frame an idle animation is currently at as it get interrupted. That way you wont need two events, but can do it with just one.

  • Thanks, I'll have a look at it today and see what happens.

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