Switching to last animation?

0 favourites
  • 3 posts
From the Asset Store
Toggles Dials Switches and Alerts ! A foundational sound grouping of Analog type switches and Steampunk effects
  • Hey friends,

    I�ve 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 doesn�t end of course.

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

    like

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

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

    Greets and thanks in advance:)

    Beaver

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sounds pretty clear to me :) I�ll try it out, when i�m at home. Thanks for that tipp and have a nice carnival :)

    Cheerio!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)