[SOLVED] How do I fix my animation

Get help using Construct 2

Post » Thu Jul 16, 2015 1:58 pm

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.
Last edited by DarKurt on Fri Jul 17, 2015 2:52 pm, edited 1 time in total.
B
2
Posts: 9
Reputation: 168

Post » Fri Jul 17, 2015 3:22 am

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,
Image
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,
Image

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 (Image) 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. :)
B
10
S
1
Posts: 72
Reputation: 1,015

Post » Fri Jul 17, 2015 2:51 pm

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. :D
B
2
Posts: 9
Reputation: 168

Post » Sat Jul 18, 2015 9:09 am

No worries man. :) It's a trick I found out through errors myself. Glad you got everything worked out! :)

Regards,
Gideon
B
10
S
1
Posts: 72
Reputation: 1,015


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 14 guests