Jungle Platform Attack Animation

Get help using Construct 2

Post » Wed Nov 27, 2013 2:42 pm

Good afternoon all,

Hate to bug people but this has been hassling me for couple hours now and i cant for the life of me figure this out.

Ive made a dummy sprite to test the Jungle Platform melee attack on but i cant seem to get the animation to run correctly.

Just as a test im trying to get it so when a certain key, in this case left shift, is pressed, the attack animation runs and if it collides with the dummy then the dummy will lose "1" from its DummyHealth variable.

Any suggestions?

A few more problems like this to work around and then i should be close to releasing my first C2 game! Such excite!

Thanks in advance :)moymoymoy2013-11-27 14:56:42
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Nov 27, 2013 3:17 pm

on key pressed "shift" set animation to "attack"
Character on collision with dummy dummy subtract 1 from health

Just make sure your attack animation has it's collision polygon placed correctly. Another option would be to spawn a hit sprite on your sword and set it to the tip of your sword while the melaa animation is running.

Instead of on collision, sometimes it's better to use is overlapping and trigger once while true.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Nov 27, 2013 3:18 pm

If this doesn't work, please make sure you haven't any conflicting events. Like for instance if character isn't moving play stance, or if character is on floor play whatever.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Nov 27, 2013 3:53 pm

Okay so ive taken what youve said into account and this is what i have:
____________________

Event: Keyboard, Shift Pressed. Action: Player, Set animation to attack

Event: Player, Collision with Dummy. Action: Dummy, subtract 1 from DummyHealth

Event: Dummy, DummyHealth </=0. Action: Dummy, Destroy
____________________

My problems now are that:
- I dont even need the attack animation to run, i can just pass the dummy and it loses health
- When the attack animation does run, it doesnt return to Idle

I KNOW ive gone wrong somewhere but still learning C2 so please bare with me.

I appreciate your time and effort with this :)
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Nov 27, 2013 3:54 pm

1. Add a condition for player collision > Attack anim must be playing
2. Attack animation On finished > Player set anim idle
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Wed Nov 27, 2013 3:55 pm

Add a condition is animation attack playing to the on collision event.

and an on animation end set animation to idle

Ninjaaad by @PlinkieLittleStain2013-11-27 15:56:15
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Nov 27, 2013 3:59 pm

Just quickly:

This "2. Attack animation On finished > Player set anim idle "

Would that be a seperate event or a subevent for the attack animation on keypress event?
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Nov 27, 2013 4:02 pm

He may already be responding but yes separate event on its own should be fine. You want the player to return to an idle stance after finishing the attack in all situations I would assume.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Wed Nov 27, 2013 4:10 pm

That is correct yeah.

The animation side of things is now working, just have to get the collision thing working. Im sure the events are correct but i'll mess around with it for a bit and see what i can come up with.

Thank you both very much for your guidance :)
B
11
S
2
G
1
Posts: 62
Reputation: 1,410


Return to How do I....?

Who is online

Users browsing this forum: max2612 and 26 guests