Problem with Collapsing Platform

I was trying to create a cardboard box platform when the player lands on it after a few second it collapses under their weight pub I am issues with the animation replaying again.

This is the video

and my events

I think I know what’s happening I believe it’s when the player jumps on the platform more than once. is there a way to disable collision after 1 hit ?

Thank you

This should do what you want you will have to change it to fit your game

Also have it so when the player is not on the platform change the animation back to normal

The sequence is happening twice because the dog is colliding with the box, then jumping, and when it lands it is setting off another collision making the sequence happen again. However many times the dog collides with box_1 within the 1 second timeframe, that’s how many times the collapsing sequence will happen.

When the dog is in collision with the box, immediately delete box_1 and replace it with a “box_1b” that is exactly the same size, shape and position. THEN continue on with the 1 second wait and everything after.

You could also have one of the animations of the box object be a collapsing animation that is trigger by the collision.

You could also tween the height of a single box object shrinking the height instead of repeatedly creating a new object at smaller and smaller heights.

I’d suggest that, instead of 6 different sprites, you have 1 box sprite with 2 animations.

One named “Solid” and has just the image of Box_1.

Name the second animation name “Collapse” and have all 6 images as the frames, and set the frame time as 0.1.

Edit the collision mask in the sprite editor for each frame. Click on .“Use a custom collision mask” button, and switch off both the “share same collision masks…” options. Adjust the collision box for each frame.

In the event you’ve posted, add the condition "Box_1 animation name = “Solid”. As the action change the animation to “Collapse”. That’s it, no waits or creating new sprites:

As an aside, you were creating the box at a hardcoded position. This isn’t the right way to do it - if there is more than one box, or the box’s position changes, it’s a lot of modifications to handle.

Instead, you should create the next sprite at the current sprite’s position, an then delete the current sprite: