Idle animation ruining attack animation

Get help using Construct 2

Post » Sun Nov 03, 2013 12:33 am

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.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Sun Nov 03, 2013 12:40 am

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.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Sun Nov 03, 2013 6:51 am

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.nimos1002013-11-03 06:58:00
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Sun Nov 03, 2013 4:07 pm

Thanks, I'll have a look at it today and see what happens.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, tarek2 and 54 guests