[Solved]Hide Layers with the same key

I’m trying to hide layers using the same key.

Every time the Escape key is pressed the layers should hide one by one. But instead they hide all at once.

I’ve placed “is visible” conditions but that doesn’t change the outcome. I’ve also tried using variables like other topics suggested but couldn’t get it to work either. I’ve actually managed to make it work in similar way to this before, but in the process of rearranging stuff I’ve messed it up.

Hi, thank you for answering.

Did you mean to swap boolean values of “Escape key pressed condition” to true and first sub condition “PauseMenu” is visible to false?

In the last event, if I press Escape to hide the layer “KeyBind”, the first event registers as “KeyBind” being hidden, resulting in closing both “KeyBind” and “PauseMenu” layers. It should only close “KeyBind” layer. How should I fix this?

When you press Escape it triggers the last event but if you’re still holding the key during the following frames then it triggers the top event. You could change it to “escape is released” or add a Boolean check to make sure the escape key is released first. Although, I can’t think of exactly how to do it at the moment.

1 Like

Thank you very much, it works now.

1 Like