[Solved] Trouble hiding and showing objects

I’ve added a Zen Mode to my game, and I can hide the appropriate objects when I click the Zen Mode button, but only if I don’t include options to show them again. If I add the events to show the objects, the events for hiding them don’t work.

If I delete the entire “show” section, the “hide” section works. If I restore the “show” section, nothing happens when I tap the Zen Mode button. I don’t see why the existence of the “show” section is breaking the “hide” section.

Any ideas?

Hi, you need to add a ‘Trigger once while true’-condition in both events, otherwise your mouse click triggers constantly.

Thanks, I tried this, and it’s still not working. Clicking/tapping the image still does nothing.

The issue is that the first event sets up the all the conditions to be met on the second event.

This is a situation where you’ll have to add another variable to flag that the first event was actioned. Something like:

It is as MrMen explained - I forgot about that and was a bit confused first trying it myself. Here is a similar but slightly different solution that uses the “Toggle boolean variable”-action:

1 Like

1 - This is best way so far i found to toggle variable using same button

2 - You would be better off just putting all your objects into new layer and hide/show that layer

I got it working! And I went with hiding the layers, which is so much cleaner.

Thanks for the help, all!

1 Like