How do I make sword attack animation

Get help using Construct 2

Post » Fri Dec 16, 2016 12:15 pm

Hi. Im making a platformer for touch screen and i have all animations of my character working but attack animation.
I put touch->is touching object->atk button->player->set animation atk
Problem is, it plays only 1st frame of attack animation (no matter if i tap or if i hold) and if i hold atk button, is stuck on 1st frame
Idle, walk, jump and fall animations work fine.

https://drive.google.com/file/d/0B7O-gj ... sp=sharing
B
25
S
6
G
2
Posts: 84
Reputation: 2,611

Post » Fri Dec 16, 2016 12:55 pm

https://www.youtube.com/watch?v=pAgUR8yJDFI

Try this. There is a series he does for fighting with a sword attack and adding sound. There is a series, but I think this part has the attack portion. You may need to watch one or two of his other videos in the series just to make sure. Good luck.

If the link doesn't work, just search YouTube with words Construct 2 Fighting game lecture
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Post » Fri Dec 16, 2016 1:05 pm

Make sure the animation speed inside the object image editor is bigger than 0, and the frames are set with a common speed, bigger mean more time between this frame and the next.
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

Post » Fri Dec 16, 2016 1:32 pm

Im subbed for months to this youtube channel. He is VERY helpful but this attack is very complicated. I thought there must be an easier way.
TELLES0808 i have everything to default as the other animations that work.

Thanks for the replys..
B
25
S
6
G
2
Posts: 84
Reputation: 2,611

Post » Fri Dec 16, 2016 1:52 pm

Double check if any of the next conditionals are not being triggered for lack of conditions, it sound like two things, first, it's setting the animation everytick to start (from begin), or an event bellow is setting it to stop the animation.

To avoid one condition to start the animation everytime it's triggered, use "System|Run once while true"
Last edited by TELLES0808 on Fri Dec 16, 2016 2:43 pm, edited 1 time in total.
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

Post » Fri Dec 16, 2016 2:22 pm

TELLES0808 wrote:Double check if any of the next conditionals are not being triggered for lack of conditions, it sound like to two things so, first is, it's setting the animation everytick to start (from begin), or an event above is setting it to stop the animation.

To avoid one condition to start the animation everytime it's triggered, use "System|Run once while true"


Great! By using "trigger once" it does not stuck on 1st frame even if i hold atk button.
The problem is platform behavior. When on floor + moving=walk, else idle animation.
I want to be able to attack (play atk animation) while idle,walking,jumping or falling

Thank you very much!
B
25
S
6
G
2
Posts: 84
Reputation: 2,611

Post » Fri Dec 16, 2016 7:15 pm

Well, i had some progress but still, if i press the fire button (tap) it only shows the first frame, if i keep it pressed, it goes to the next frame and stays there till i release the fire button.
If i put in "on tap object" nothing happens.

Edit : Ok, ive found it! I had to put to my player an instant var to be 1 when i attack and 0 when i dont. Now everything works! :)
B
25
S
6
G
2
Posts: 84
Reputation: 2,611


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 48 guests