Switching to last animation?

0 favourites
  • 3 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • 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


    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:)


  • 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


    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 :)


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