UMG not updating variables cross blueprint?

Hey all!

Title pretty much sums it up…
I create my UI in my level blueprint, it gets added to the viewport.
When a button is clicked, a new UI appears on the screen and the current one is removed,
A variable is updated that is bound to certain text in another widget, but the text doesn’t update… Can anyone help? It’s like my variable pointing to the other blueprint doesn’t even exist!

basically, remove or delete yourself is not a good idea.
even deleteActor should be done on server.

1 Like

Any suggestions on how to improve?

“PenguinTD” is kinda right but in this context isn’t anything you need to worry about. The only time you need to do anything server side is when it affects gameplay for every player. UI elements in most cases are client side only (just visual) and reference external variables controlled by the server. When dealing with UMG the only way to remove a widget from the viewport is to use the “Remove From Viewport” node. When you reference self in this node it refers to the widget that’s calling it which in most cases with be the widget you want to remove, there’s nothing wrong with what you’ve done here.

The question is whats “Widget Const UI”? Have you defined a created widget to store inside it? If you have then the next question is how is that text variable used inside the widget? Are the text blocks actually setting their text to the variable your trying to set?

I hope this helps.

@pattym: Yeah, thanks for correcting me. I’m just putting a brain fart out of context.

Oh, to contribute a tiny thing, you can’t use switchHasAuthority to make sure you are “client” to do UMG stuff, otherwise your listen server won’t work.
To check(before create/add/remove has built-in check maybe in 4.5), use the isLocalPlayerController function node from your controller.

Also, to blindman457, you should search Rama’s UMG tutorial and get a general idea of how to set things up.
Nick’s(the developer) document is just too bare bone as of now.

And, I use widget switcher to change between different menus I have. ie. pause menu->multiplayer menu-> join to type ip menu.
When I run a actual function(instead of click on navigation only buttons), then it will call a interface function to my PlayerController BP that handles setting widget back to top level(index 0) and remove UMG widget from viewport.

Yep! That’s what I’m trying to do… The 'Widget Const UI" is an object reference and those text references are bound to text blocks which are ‘suppose to’ update their contents to whatever the text variables are holding.

In short, think of a navigation menu… When a button is clicked to navigate, a new widget pops up, grabs a reference to the ‘Const UI’ widget and tells it to update it’s title text with the contents in the text variables. Problem is the text isn’t updating…