Hello, I've been trying to do this thing where if the player overlaps with the box collider "Trigger" it will set a button Visibility to being visible by default it's collapsed thanks -VSC

So i think you already did this but just in case, make sure the button’s visibility is collapsed by default, and make sure the button is a variable as well (In the top right).

Now that the button has its own variable reference you can use it to execute logic.

Hello! Thank you for the advice I appreciate it. Um I do have a question the Begin Overlap Event how would I get that from the Trigger into the button’s code thanks! -VSC

Could you also provide more detail on how overlapping with the Actor that has a trigger in it would set the button visibliity to visible please.

I believe you are asking how you could get the box collider to tell the button to set its visibility, if that’s the case, you can copy the following code:

Basically what this does, is you can use the get all widgets of class and get the first one (index 0) and call different functions and events from inside that widget with the output of the get node.

Does that make sense?

If you want to have something communicate with an actor, you would use the get actor of class node.

So basically you can create events/functions and directly call them from the output of the get actor/widget node.

I was using the “Do This” and “Do That” as a example to explain that you can call events and functions like you are with the do this node. You should switch out the Do This node for the visibility event, and make sure to hook the get node as well.

Also its attempting to access the widget but its failing because its not in the viewport yet, a workaround to get rid of that error popping up is to use the “Is Valid Node”

Make sure the widget exists in the viewport before trying to run any logic on it, if you havent already done so, here is how you add a widget to the viewport:

Let me know how that goes or if you don’t understand something. :slight_smile:

I don’t know if the problem is because I have a pause menu and the player has to click the main menu button in order to go back to the main menu and then the button should show up that’s how I planned it to work.

If you are doing a pause menu for going back to the main menu, i believe what most people do is add a main menu button widget to the viewport when you press escape and if that button gets pressed you might want to load a main menu level and in the level blueprint, construct the main menu widget and add it to the viewport.

Yes, the main menu is already covered what I tried to say if the player is in the main level and they return to the main menu how Could I make the Button become visible only if the player Overlapped with the Actor’s Trigger Box once they return to the menu. basically I want to use the trigger as an end point for the game I’m dividing the game in chapters that’s why Once the player overlaps with the actor I would like for the button to become visible.

You might be able to use the game instance, as it is persistent across levels. It’s been so long since i added the game instance so you may have to google how to do it (It’s really simple) but i think you just make a game instance class and set it in the game mode. Anyway you could probably add a Boolean variable in the game instance that gets set when you overlap the box, and then when the main menu widget loads, you could set the visibility like this:


(Plug the select node into the visibility Enum to get the true and false options)

alright I got the code you had in the screenshot what would you like for me to do next? and also How do I get the Was Box Overlapped to communicate with the trigger test actor

You would make a boolean inside the game instance, and set it from inside the blueprint with the trigger box collision, and then pull the booleans value from the game instance and use it for the set visibility event (was box overlapped?)


Alright I Put the boolean inside the game instance and brought it into the actor does this look right?
also would there be any videos you might recommend?

Almost, make sure to create the boolean inside the game instance:

Also make sure your game instance is set in the project settings (Search game instance and set the object).

Then when casting from the game instance like you already are, from the output set the boolean “Was Overlapped” to true.

Get rid of the get all widgets of class and everything after it because you want to do that from inside the widget when it gets added to the viewport. So from inside the widget, on construct, run the set visibility to the boolean from get game instance.

I got it Thank You so much for the advice sorry if I was a bit annoying to you haha Has yourself a good day.

No worries, glad you got it working. We all need a little help every now and then, my advice is to start utilizing chatgpt when you are stuck, it isn’t always correct but more times than not it is beyond helpful :slight_smile: