Character Falls Through Platformed When Any Animation Is Triggered

I’m trying to make a 2d platformer. But when I add a program to trigger an animation, like “press r key to punch”, it falls through the platform.

How do I stop the character from phasing through every time I add a new animation and a code to trigger that new animation?

Here’s a screenshot of the code for the punch animation. Just to be clear, I haven’t programmed anything like melee damage, just the punch animation:

if it falls through the ground. then its a collision problem, not an animation problem.

wich part of your code deal with gravity and collision with the ground? and provide a screenshot of that.

it it through the built in 2D physics engine? does both the ground and the player has the physics behaviour?

Your events mean nothing

Your issue is you have different animation sizes or collision masks on these animations
And when you change animation part of your player is inside wall and is getting pushed out of it
Which for you looks like its going trough wall

Looking at image of your player which looks like vertical rectangle
other animations would need to be exactly same for it to work perfectly
Otherwise you get what you have

(In general ALL your images of all animations should be as big as biggest animation you have
It is possible to have different size images per animation but that is hell to manage)