Download

Change visibility in UMG

So I am trying to make a sub part of my menu and I got all my things in place.

52eda62622e4fd3a29c2a14f3c7a6efe.png

I was trying to get just the facebook button to hide and show, so I did bind on the facebook button:

Then, I assigned a click function to a button I had:

But the facebook button doesn’t get turned on or off. Any suggestions?

You don’t have an execution wire going into the Set node that sets M FB Var to Hidden. If there’s only one button that will toggle it on and off you could use a Flip Flop node, or a Branch node with a boolean setup. Also that bit with the variable seems a bit unnecessary. I’d do it like this:

Ross is correct the execution node wasn’t connected to “set visible to false”. Also any time you need to toggle anything on and off such as visibility the flip flop node is your friend. Let us know if this doesn’t fix your issue.

I am afraid it doesn’t fix my issue. I tried to set my button to the highest Z order, even try with a different button, even try to change the visibility of a text to see if the problem was trying to turn off an image and that it could result in a bug. But nope, I don’t seem to get what I am doing wrong…

Ill look into it when i get home.

Huh. So you can’t get changing visibility to work for anything? You tried the exact node setup that I posted and it didn’t work? And there’s no conflicts, you’re not trying to set it in two places or anything? And there are no parent UI objects that are set invisible? If you post some more screenshots of what you are doing we might see something.

I tested it and it works on both the image widget and a button.


What ever event you are using to toggle the visibility or hide it should be attached to the in exec pin of the lip flop such as another button being clicked which is your case. Make the widget a variable and plug it into the target of the set visibility node. No need in having an enum when you can just manually set it which I did in this case. One thing I will note is you have to click twice on the first time to get the button to work. Probably has something to do with click events.

Did you ever get it to work UpARiver?

Actually, I have several widgets that I want turned off. Does this method applies to several widgets as well? Cause Its not working.

Sorry for only answering now, I have been busy.

UPDATE: I have managed to make it work by using an integer and changing the definition of my button, so for those curious:

1- Switch Int
2-On each definition of visibility, I have increased the int by 1, so the next time you click on that button, it changed the visibility on other things.

Thanks for the help everyone!