Remove Box when hit underneath?

I don’t know how to get this to work. I have a box that when hit underneath it should disappear. I have set rules when player is jumping and collision with the box, the box would dissapear and when standing on it it does not (as it should)

But it does not dissapear when hit underneath, but it does dissapear when hit from the side, but it does dissapear when hitting it underneath if pressing jump and left or right.

How should i set rules?

Also. Is it possible to add javascript explotion so there is some pixels flying away? Where do i add this instead of image animation?

check the “hitboxes” of the sprites that would collide. Maybe for a few pixels the two objects don’t collide when one is on top of the other.

When you delete the object, make a subevent that creates a particle emitter. Use little blockpeaces as image for the particles.

As for destroying your block you can place a hitbox object under your box, give it a variable Id and the box the same id too. Then check collusion with the hitbox instead the box, and delete both.

1 Like

Ii did try but it does not delete the box when i stand still and jump, only when pressing jump and left or right.

Player is in collision with Box1
Player is jumping

And

Delete Box1

I did try creating a flat box in the bottom and make it delete the box when touching but it does the same. Is not jumping the right option to use?

i just tested it, and it works exactly as i thought.


box2
i put a timer there, so the player is still bumping his head and then the block breaks.
if you want to jump through it you dont need a timer.

Oh, i see. I did the same as you…almost i did deleted the action and did it again, and now it worked. I must have done somethibg wrong at the beginning. Thank you. :blush: