How do I execute action when animation finished for Familly?

0 favourites
  • 9 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hello,

    I wanted to execute action when Animation for a Familly is finished, but it didn't work, for now reason.

    Juste found an old discussion about that, but no anwser :

    construct.net/en/forum/construct-2/how-do-i-18/animation-finished-trigger-44586

    Is it a known bug, or there is another solution?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's unlikely to be a bug, can you share what you did ?

  • Sure!

    Sorry it's in french, but I'll translate.

    I start a For Each Collide object

    - If Collide Boolean isAttacking is on

    - If Familly.sprites.ID is = Collide ID

    - - If Animation is finished

    - => Set Colide Boolean to off.

    All the condition are true.

    if I remplace animation finished by "animation frame = 4" it's work, but I prefer to have something more flexible and not limited my animations to a same number.

  • you have on animation finished which is a trigger. I think that is the problem.

    I would put the on animation finished as the first event and then have the others as sub events below.

  • from the documentation:

    However, triggers are an exception. See the green arrow to the left of Keyboard: On Space pressed from the previous example:

    An event with a triggered condition

    This indicates the event is triggered. Rather than running once per tick, this event simply runs (or "fires") upon something actually happening. In this case, the event runs when the user hits the Spacebar key on the keyboard. It is never checked any other time. Since triggers run upon an event happening, they aren't checked in top-to-bottom order like other events. This means the ordering of triggers relative to other events is not important (except relative to other triggers of the same type, since triggers still fire top-to-bottom).

    There can only be one trigger in an event, because two triggers cannot fire simultaneously. However, multiple triggers can be placed in 'Or' blocks (see the next section).

    https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events/how-events-work

  • Oh I see... that's working now.

    I didn't know that, thanks a lot!

  • Hum, in fact, it seems to partialy works.

    The condition execute only once and didn't works for the others Sprite.Familly object after :

    Maybe I doing something wrong again?

  • I'm not certain but it could be that picking the hitbox doesn't work correctly.

    I would do something like this:

    On animation "attacking" finished

    pick hitbox by comparison: hitbox.id = attacker.id

    set hitbox attacking to false

  • Same result that way.

    I found a solution, don't know if it's the good one, but it seems to works.

    I start by :

    - If Colide.ID => Attacker.ID

    - If Boolean attack => True

    -- If Animation is finished

    -- =>set Boolean to false

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