Animation Finished

0 favourites
  • 6 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • I cant get the Animation finished to work... What am I doing wrong...

    Global Set a_Mode=0

    Group OPENBAY

    --System Trigger once

    System a_Mode = 0    

    ----Sprite set animation to "Open"

    ----Sprite start animation from beginning

    --Sprite On Animation "Open" Finished

    ----System Set a_Mode to 1

    Group CLOSEBAY

    --System Trigger once

    System a_Mode = 1    

    ----Sprite set animation to "Close"

    ----Sprite start animation from beginning

    --Sprite On Animation "Close" Finished

    ----System Set a_Mode to 2

    Here is the example:

    Capx file

  • Oops, the problem, I guess you might want to know that...

    It runs the Open animation (not set to loop) then sits there. If I put the On animation finished as a sub event of Play animation, it repetitively opens...   Strange...

  • What you described:

    <img src="http://dl.dropbox.com/u/36472942/construct/forumhelp/whatyougave.png" border="0" />

    My solution:

    <img src="http://dl.dropbox.com/u/36472942/construct/forumhelp/Mysolution.png" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Kyatric! That fixed the problem. (P.S. Sorry about making you build that thing. I posted the capx, but was to late... YOUR FAST!)

    Is that a Group Glitch? Or is it a issue with Animation finished... OR, did I need a Trigger once for the animation finished... (Just thinking out loud now..)

  • It is just a matter of how events work.

    In the version as you setted it up, you set an animation to play, and then (since it was a subevent) in the same tick (and only this tick since you had Trigger once while true) you tested if the animation was finished.

    Logicaly, it wasn't.

    And so CloseBay actually never fired too since a_mode never went to 1.

    You probably can do all this in a single group, but I respected the structure you gave at first, giving it a bit more sense with the activating/deactivating of the other group.

  • Thanks for the refresher. I needed to re-read how that works. Makes sense now <img src="smileys/smiley20.gif" border="0" align="middle" />

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