Disable buttons

Hi everyone hope you are all well

How do you disable certain buttons from working when certain thinks are happening? for example the player dies but there is a few second player animation of the payer dying but you can still move and fire during the animation

Thanks

1 Like

Hi

Try to add this to your event of collision or when the player dies.

  • action- pause the animation of (player)
  • action -Activate behavior PlatformerObject of (player): no
  • set animation of (player) to “your animation”

New event

  • condition - the animation of “player” is paused
  • action - play the animation of player

Hope this helps :slightly_smiling_face:

I’m not sure exactly what you mean, but I would just add another condition to the “button” condition. Something like:

If [press button]
Death animation is playing (inverted) - [Some action]

So, it’s not a sub-event, but just an event with two conditions. Though, if you wanted to, you could check “if death animation is playing” in an “over”-event and have all the other button presses as sub-events.

What’s the opposite of sub-event? Over event? Dom-event? Just Event? Huh…

Toodles!

Just add player Stop all moves/forces. When the player die so it will stop at the point X/Y then play die animation.
Plus you can add some ignore/disable inputs when player is dying.
Try to control the player is dead with some Object variable or just check his hp or life, so for instance if player hp = 0 or
player life = 0 or
player_is_alive = true in case of using a variable o globalvariable.