Invulnerable after being hit

On the platformer I am making I would like to make the player Invulnerable after taking damage I have used the Flash Blink for the animation but don’t know where to start at making it so the player doesn’t take any future damage for 2 seconds or so.

Does anyone know an easy way to implement this.

Thanks

You can use an object number variable and a tween. Set the value initially to 0. When the player takes damage, set it to a number greater than 0 (my example below it’s 2), and then tween the variable to 0.

When checking for collision, also check that the player object variable is 0.

Here’s an example (this is also the event that inflicts damage and flashes the player):

1 Like

If you’re using the health behavior, it has a damage cooldown time setting.

1 Like