How do I stop animation loop?

0 favourites
  • 14 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I know this looks like a really noob question, but I've been using Construct 3 to test it's functions, but I came back to Construct 2 since I reached Free Edition limits.

    While I was converting the code line by line, I can't make the fall animation stop looping. I really don't know what to do (maybe I'm really tired and can't see something).

    The code is the same for both Engines, but the problem persist only in C2.

    Okay so: I've made a Wall Jump system. If you Jump while in Wall, Jump animation triggers normally.

    If you don't jump and just fall from the Wall, it's supposed to play the fall animation (3 frames). But the animation keeps looping.

    If I put

    /Platform On Fall > Set Animation to "Fall"

    The animation just doesn't play. It get stuck with the "Wall Slide" animation.

    If I put

    /Platform is Falling > Set Animation to "Fall"

    The "Fall" animation loops, but I want it to stop at the last frame.

    The code is the same for both engines. I've disabled "loop" on animation properties.

    I'll post Screenshot of both of then, with the video showing the error.

    CONSTRUCT 3 EVENTS (works just fine)

    CONSTRUCT 2 EVENTS (doesn't work)

    Subscribe to Construct videos now

    Tagged:

  • Well there's a few weird things about this. The Construct 2 events are actually doing what you asked, I would expect the animation to loop. Construct 3 must think you're still on the floor for some reason but I can't see the video for that. That event isn't needed anyway, if you have an event that says on fall set animation to fall then you don't need any additional event saying if not on floor and falling then set animation to fall, which runs every tick and will be seen to loop.

  • Sorry about the delay. Here's a video of what happens if there's only one event saying [On Fall > Set Animation to "Fall"].

    CONSTRUCT 2 VIDEO

    Subscribe to Construct videos now

    While I tryed to record a video of Construct 3 working just fine, it actually became broken like Construct 2... now I'm doubting myself and trying to argument with my own head if it was a delirium or not... anyway. I just want it to work, I'm getting really frustrated about it. :(

  • I think it is because at the moment your character starts to fall, it is still in contact with the wall during one tick, just enough to make the "has a wall" condition true, and when your character is wall sliding, the "on fall" condition is already met so it can't trigger again;

    What you can do is :

    On left key released;

    Wallslide is playing;

    Has a wall to the left;

    -> Set animation to fall

    Same for the right side, try it and tell me if it works

  • But your latest video doesn't show the 'error' which is the animation looping, so it's fixed? :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I get it right the problem is either the fall animation loops or it doesn't play at all depending of the code, that's what the videos show

  • Fair enough, it looks fine at about 18 seconds in the video but elsewhere the wall jump is overruling it because of the conflicting code about having walls to the left and right. The looping is fixed though which is all I was trying to resolve haha

  • For a moment I thought it was going to work,and it did, but there's a couple things out of place now... looks like one problem is half-solved and others appeared.

    20s to 27s: The fall animation plays, but only after some time. The character still play the Wall animation for a moment.

    28s to 35s: Trying a little bit more, we can se the problema above only happens when I slide down. If I get out of the wall as soon as I get to it, the Fall animation plays without error.

    38s to 47s: If I Jump while on the Wall, the Fall animation doesn't play.

    48s to 56s: As above, the problem only shows up when the character slide.

    Subscribe to Construct videos now

    I want to say already that I really appreciate the help and the support <3

  • Did you try the method I sent you? Also if you're confortable sending your capx I can try to mess around with the code and find a solution, I already worked on wallslides before

  • Yes I tried. , you can see the code on the Video 3.

    That's really lovely from you, taking your time to help me, I really appreciate it.

    I didn't find a way to upload it directly to de forum, so I've uploaded it to MEGA.

    mega.nz

  • Ah sorry I didn't focused correctly on the code part, now I see what's wrong, instead of checking if player has wall to left or right, it checks if there is no wall, the result won't be the same;

    Also no problem I don't mind giving some help ^^ I'll look in depth tomorrow when I get some time

  • Alright it's fixed! You'll see that I reorganised the event a bit differently, so the Fall animation can trigger corretly but the character can also walljump when close to a wall and not necessarly falling;

    mega.nz

    Also this is a little bonus but I added two extra frames to the jump animation, so it was easier to check the walljump feedback ^^

    Something I can recommend tho is to use a mask sprite that will act as the hitbox and pin the sprite to it, to avoid any hitbox and origin inconsistencies, for example the origin of fall animation was making the sprite a little jumpy because not well placed compared to jump origin, with a single box sprite you can avoid this easily ~

  • Bumping just to be sure you got the notification, as the website was a bit buggy for me recently

  • You actually drew some sprites!

    Really interesting, the way you make it work. Thanks a lot for your effort! I'll sure remember it.

    About the Pin Sprites, I noticed this with some example games, but thought it was because it's easier to program this way. Looks like it's more than just comfort then. I'll search about it, thanks a lot about your time and your tips!

    PS.: I didn't get a notification, thanks a lot about the bump.

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