Using umg buttons to toggle visibility of objects

This is just a simple test project but I cant get it to work,

I want to have 2 buttons on the bottom of the screen and when they are clicked they toggle the visibility of a sphere and a cube that i have in the level.

I got the widget to show on start but I dont know how to assign onclick events to the buttons to toggle the visibility of the objects.

Hello BoBar,

You will need to the objects that you are wanting to hide. I have an example of which I will post a screen shot below that may help you out. In this example I have created a button click event that when clicked gets a reference to the actor that is in the level and then sets it’s visibility. I hope that this helps.


Make it a great day