How do I stop an animation while another one is playing?

Get help using Construct 2

Post » Sun Apr 27, 2014 6:38 am

To invert a condition you just need to right lick it and select invert.

Another easy way would be to give your character object an 'instance variable' or 'Boolean' called colliding.

In your collision event set the Boolean to true or the variable to 1, then use the timer object to revert it back to normal when your animation is due to finish. Then just add another condition to your 'on any touch end' event that makes sure that the Boolean is false or variable is set to 0 before it sets the animation.
ImageImage
B
112
S
23
G
7
Posts: 1,064
Reputation: 12,787

Post » Sun Apr 27, 2014 11:03 am

You can invert most of the conditions by right clicking on them and choose "invert" from the drop down menu. You should see a red cross-hashed "equals" symbol.

e.g. Image
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sun Apr 27, 2014 11:05 am

Oh... I was to slow ;)
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sun Apr 27, 2014 4:59 pm

Hahaha... thanks a lot guys, that did the trick. It works now:)
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Sun Apr 27, 2014 5:46 pm

To invert an event, you right click the event and choose "Invert condition" or "Invert Event"
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sat Aug 09, 2014 7:51 pm

So i'm having kinda the same problem here, when i press "X" my player does the shooting animation but i can still walk and do the walking animation but that's not what i want.
TL;DR: while the shooting animation is play what i want is that i can't do anything until it's finished, i can't walk or play the walking animation.. a little help would be cool :)
B
21
S
6
Posts: 244
Reputation: 2,655

Post » Sun Aug 10, 2014 1:04 am

Can you attach your capx (a simplified version will do) for us to see and build upon..?

Other than that, I think that adding the "shootingAnimation" is NOT playing as a condition in your movement controls will make your character stop while shooting (you'll have to make the events that move your player in the event sheet, otherwise Construct won't know that the "is NOT playing" condition is meant to be paired with a key press that's related to movement).
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sun Aug 10, 2014 4:39 am

Well here's the capx:
ShootingAnimation problem.capx


and i haven't got a hold of the jumping animation or system.. if you could help me with that too :D

have a nice day :)
You do not have the required permissions to view the files attached to this post.
B
21
S
6
Posts: 244
Reputation: 2,655

Post » Sun Aug 10, 2014 9:42 am

@Wisdoms , there you go!

I removed some unnecessary animations and disabled some events that were obsolete. The main difference and most important thing that you should consider is that it is not recommended to use the sprite that holds the graphics and the animations (in your case the "Enemy") for the Platforming movements and collisions. You should use a dummy Sprite for that and Pin your graphics to that sprite.

Other than that, I really like your aesthetic, keep it up!!! ;)
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sun Aug 10, 2014 11:03 am

Wow, thanks so much for spending your time on this.
but there's a problem, though.. when i press X and the shooting animation plays and i press the Left or Right button the animation mirrors.. i don't know if it's possible to avoid that in construct or not.. but thank you anyway :D
B
21
S
6
Posts: 244
Reputation: 2,655

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: FlyingRam, Google [Bot] and 8 guests