[SOLVED] Falling Animation Trigger Stops Working

Get help using Construct 2

Post » Wed Feb 13, 2013 3:19 am

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

-Bensman1182013-02-14 13:50:11
B
40
S
11
G
6
Posts: 228
Reputation: 6,951

Post » Wed Feb 13, 2013 4:22 am

@sman118 -

event 22 change to:
system - FlyToggle = 0
Player - Platform is not on floor
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Wed Feb 13, 2013 11:19 am

@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?
B
40
S
11
G
6
Posts: 228
Reputation: 6,951

Post » Wed Feb 13, 2013 6:13 pm

@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

wretchedshark2013-02-13 18:13:46
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Thu Feb 14, 2013 12:43 am



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.
B
40
S
11
G
6
Posts: 228
Reputation: 6,951

Post » Thu Feb 14, 2013 4:21 am

@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.

wretchedshark2013-02-14 04:22:03
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Thu Feb 14, 2013 11:33 am

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.
B
40
S
11
G
6
Posts: 228
Reputation: 6,951

Post » Thu Feb 14, 2013 12:28 pm

glad i could help, your game looks awesome!
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Thu Feb 14, 2013 3:03 pm

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...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Thu Feb 14, 2013 6:04 pm

Thanks, @BluePhaze. 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.
B
40
S
11
G
6
Posts: 228
Reputation: 6,951

Next

Return to How do I....?

Who is online

Users browsing this forum: ETgirl79 and 15 guests