Multiple Button Puzzle

You could try adding a bool that’s instance editable called bSolutionButton, for example, that when the instance is turned on, if true runs a custom event in the level blueprint adding 1 to a variable. If the bSolutionButton is false on a tile the player activates, it calls the event and resets all tiles / player dies / etc.

Having that bool instance editable allows you to set it and iterate in editor. The event inside the instance will either +1 if true or reset if false.

the idea of adding 1 is to check that when a tile is activated, if that variable equals to total of solution tiles, player completed puzzle. So you don’t actually check the buttons, you just check if the player has activated the total amount without interrupting the count (without activating the none valid ones).

You could also create a function on begin play that checks the tiles to count the total amount of valid tiles. So after setting it up all you have to do is tick those that are valid and it takes care of itself.

Edit: Link to a quick test.

My puzzle is a player who has big buttons on the floor and can jump on top of them, changing their color, symbolizing they are on. The solution to the puzzle is turning on specific ones. I made a simple mesh of a button, to conserve space, and dragged copies of it into the level.
The issue I am having is designating which “Button On” variables need to be true to complete the puzzle, and how to check them all in the level blueprint.
Any help would be greatly appreciated.

How do you call a custom event that is in the Level Blueprint, from the Mesh BluePrint? I made a customer event in the level blueprint, but it doesn’t show up in my Mesh blueprint.

If you’re saying you don’t know how to Identify which button you’re changing because they’re all the same blueprint class, you can still give them unique values.

The simplest way, just give them an exposed variable… like this.

Making it editable you can give each button an index # as you place them.

Then when you jump on them,…

You have to use Event Dispatchers to bind the events in the level BP: HTF do I? Event Dispatchers in Unreal Engine 4 - YouTube

If you want an example for this specific puzzle, I could share later tonight how I did it in the link above.

I followed the video and this is what I did to the end of my button mesh blueprint, and what I added to my level blueprint. For some reason, the level blueprint is not getting called when I step on the button.

^ Definitely something you’ll need to learn at some point, so worth the look.

But you don’t want to place events in your level blueprint, as a general rule.
The only real reason to do so would be to have that event available at all times across any map in your game…
But you can do that with a simple GameInstance and be able to reference it the same as your other blueprint classes. Cast, Get, etc.

Things like level and remaining lives need to be there anyway, so personally, I put everything that would make up a game’s Save, build a structure out of it, and put that into the GameInstance.
it cleans up save/load and I never have to remember where I’m keeping a variable when I need it.-

When you right click the event Dispatcher and select Open Graph, make sure the first node is the only one with the variable:

This is what the call node in the actor should look like:


In the Level Blueprint, when you bind the event, make sure you create a matching event:

After that, it should work just fine:


The Compiler Results tab bellow tells you if there is a problem.