[SOLVED] Falling Animation Trigger Stops Working

0 favourites
  • 10 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • This is a little difficult to explain, but I will try my best:

    Right now I have the player set up with both 8-way movement and platformer that toggles with a press of the F key. The 8-Way movement is used for when the player is flying and the platformer for walking. Holding the A key while flying makes you fly faster.

    Normally, when you press F while flying, you'll switch to platformer mode and the falling animation is triggered. If you fly around fast for a bit first, the falling isn't triggered and the animation freezes on whatever is playing when the button is pressed.

    Any help in figuring this out is greatly appreciated.

    Go here to play the most current build: Superhero Build 2-12-13

    Download Capx file here: Superhero Game Capx

    -Ben

  • sman118 -

    event 22 change to:

    system - FlyToggle = 0

    Player - Platform is not on floor

  • wretchedshark that didn't seem to work. It stopped the freezing on the animation, but it just loops the first part of the fall animation. I had a similar problem when I used the condition "is falling".

    The way the animation is set up, after the "fall" animation, I have a Fall Loop animation that its supposed to go into. The loop is supposed to trigger at the end of the fall animation, but it doesn't happen if I make your changes or use an "is falling" condition.

    Thanks for the help. Any other ideas?

  • sman118 - oh kay i see! i think this is working now, let me know.

    toggle disable the event with the "PlayerAnim on animation "Fall" finished" condition and "fallLoop" action (i added events so i think it was event 23?)

    event 22 now looks like

    22- player - platform is not on floor

    22- System - FlyToggle = 0

       23 - (sub-event) - player - platform on fall > (action) PlayerAnim - Set animation to "Fall" play from beginning

        24- (separate sub-event) - PlayerAnim - on animation "Fall" finished - (action) PlayerAnim "FallLoop" play from beginning

  • <img src="https://dl.dropbox.com/u/56104169/FallingEventSheet%202-13-13.jpg" border="0" />

    I'm still having the trouble. The best way to see what I'm talking about is (while flying) press the F key to drop. Then, before you hit the ground, press F to start flying again. Fly up a little bit and hit F a third time to drop and it should just be in the idle animation.

    Its really weird. Almost like its not realizing that its falling. I had to do a similar thing in the past when it would remember my last jump when I pressed F in the middle of it. Another user told me to set the X and Y variables to zero every time I toggled to flying. Maybe its something like that where I would reset the 8 Way movement somehow. I've already got it set to 8 Way Movement -> Stop whenever I toggle on to flying.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sman118 - i see what you mean, this seems to be working.

    add an instance variable to PlayerAnim called fallFinished, its a boolean and default is set to false. update event 22 as follows and add two more events to reset it to false.

    <img src="https://dl.dropbox.com/s/9uy4ndtjgiw48p4/sman118_fix.jpg" border="0" />

  • You are awesome! The only condition I had to add to it was in Event 22 - Player -> Is Jumping (inverted) because it wasn't playing the beginning part of the animation. Besides that, it works perfectly. I'm in awe of your Construct 2 Kung Fu.

  • glad i could help, your game looks awesome! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • One thing to test as well is how it reacts when you are on the very edge of platforms.... I had issues with this as it seems sometimes if you are on the very edge it counts as falling and triggers animations. Usually this happens on objects that are not using a separate collision rectangle and are instead using their own shape for collisions which can cause the collision polygon to change shape depending on the frame of animation...

  • Thanks, I'll give that a try when I get home. I'm using a separate collision polygon so hopefully it won't be too much of a problem.

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