(Solved) How to make the same key show and hide sprites?

Hello, very new to Gdevelop and I’m not sure how to do this.
What I want is:
(“Sign1” is just a scene group with stuff I want to show up)

-When the player is in collision with sign and they press the e key, “Sign1”
is shown.

-When the player wants to quit out of “Sign1”, they press e again, and “Sign1” dissapears.

-Then, if they want “Sign1” to show up again, they press e again, and so on.

I want the e key to be used both to show and hide Sign1, but I’m not sure how.

I know that they way I did it on the image is wrong, and it doesn’t work. But how do I make it work as intended?

Here is a solution:

and here an example that shows how you can do that:

I did that and it sort of worked? The thing is, I can now show and hide Sign1, but when I press e, it flickers constantly. Sometimes a click just doesn’t work at all, just makes Sign1 hide and show several times quickly, and sometimes it does work, but also makes it flicker a lot. When I try to screen record, it looks more or less fine, but in the preview, it flashes really badly. No idea why, or why it doesn’t register in a screen recording properly.

Edit, turns out adding a “trigger once” condition fixed it, thanks for your help!

1 Like