0 Favourites

How do I make an animation stay after collission

  • Hello all , I'm with a little problem on creating my HUD for my game.On my HUD I have a character head, and I want that for example, after colliding with anything that deals damage, it shows a sad face, when it dies another face and when colliding ( pickink up ) a coin and killing a monster it shows a happy face.

    I have already the animations, its simple ones with just 1 frame, i tested it on many ways and or the animation of the collisions stay forever and do not turn back into the default, or when I collide it happens so fast that you almost cant see it. So... I want to know how can I put an animation when it collides, and only change back to the default after 1 or maybe 2 seconds. Thank you, have a good day/night

  • Hey there!

    So I'm not 100% sure how you've got your stuff set up, but you could always try something like:

    player>on collision with object

    set animation > "happy"

    Wait 1 second

    Set animation to normal

    Depending on how you are making your player, there could be other ways to do this. For now I think this will work.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Open the sprite editor, set Speed to 0, and loop to NO, and repete to 0.

    When you want to change the frame, just use the "set frame" in the sprites animation action.

  • I'd suggest adding the timer behaviour, could be usefull for many more features

    Then you could make these events:

    on timer "changeback"

    set the face to default

    on collision

    set face to whatever

    start timer "changeback for 2.5" seconds

    Something like this should work..

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