Hello, it’s me again. I would like to make it so that if my character runs out of health, he gets thrown into the air a little bit, and then falls off of the level, passing through every obstacle, kinda like Mario’s death animation. I tried to replicate this, but my solutions were either unsatisfying, awkward, or just didn’t work properly. One of my solutions was to make the platformer character a Physics 2.0 object too, and have the behavior only activate when he dies. This didn’t work so well, and this may break some other parts of my game. Can anybody help me? Is it possible to make a death animation similar to Mario’s by having the character fall through the level without any collisions? Thanks in advance.
You could increase the jump speed and simulate a jump.
Then increase the Max. Falling speed and remove platform behavior from ground, if necessary put the player z-order to 999.
I ran into this same problem, and finally solved it in the following way. When something happens that “kills” the player (in my game the player’s name is Ozzy), then one of his variables is set to “dead”. Once that happens, a chain of events is set (change in animation, sound effect, decrease a life, etc.). What also happens is this:
As you can see, I deactivate the behavior “PlatformerObject” (he also has a “Pathfinding” behavior for other movement purposes). Once PlatformerObject behavior is deactivated, he doesn’t interact with other objects the same way. You could also set his Z order really high to make sure he doesn’t get covered up by other objects.
Additionally, setting the “dead” variable sets off a series of timers that have corresponding movements to make him bounce up a little bit, then fall down off the bottom of the screen. Works great when combined with a “dead” sprite and a sound effect.
Hope that helps!
Thank you, that works!