Switching to last animation?

Get help using Construct 2

Post » Mon Feb 11, 2013 6:47 am

Hey friends,

Ive got a problem :)

I organized the weapons of my character using different animations. Works pretty fine so far. Now I want to add some gettin-shot-effects and if I use "set animation", the effect doesnt end of course.

Is there any possibility, to switch back to my latest animation

like

MachineGunAnimation -> hit-by-bullet-animation -> MachineGunAnimation

I cant just add MachineGunAnimation again, because he can carry different weapos while getting hit.

Greets and thanks in advance:)

Beaver
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,152
Reputation: 9,886

Post » Mon Feb 11, 2013 7:18 am

I would use a variable to track what animation I was in, then read from that variable at the end of the current animation to decide which animation to go back to. For example:

Variable: lastAnimation

Action:
On Fire Play Animation (MachineGunAnimation) Play from beginning

On player collision with bullet Set lastAnimation to MachineGunAnimation
Play Animation (hit-By-bullet) Play from beginning

On hit-by-bullet animation end, play animation (lastAnimation)

LastAnimation at that point should be the MachineGunAnimation.

Sorry if my psuedo code doesn't match up on syntax, I don't have C2 in front of me right now.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Mon Feb 11, 2013 7:59 am

Sounds pretty clear to me :) Ill try it out, when im at home. Thanks for that tipp and have a nice carnival :)

Cheerio!
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,152
Reputation: 9,886


Return to How do I....?

Who is online

Users browsing this forum: Braus and 15 guests