Problem with UMG and Updating Text/Numbers

i have been getting this really strange problem and i cant figure it out. I want the text on my UMG Widget to update at a specific point, which i already have setup and is working, however, when it updates the text, the it seems that there is a second text of the old/first text behind the new updated text. It is also occurring on a Text label that i am not even changing (not editable). Here is what i am trying to explain.

428120be07e7a6111e1e0df829a3d80b.png

428120be07e7a6111e1e0df829a3d80b.png

Its the number which i am trying to increment, and its the ‘‘Wave:’’ which is constant, but used to do the same thing as the number, but just with the same ''Wave:" text, but i cant seem to reproduce that problem (with the wave text) since/after i changed some things around that i cant remember. I want the “Wave:” To stay the same always, but the wave number(‘WaveText’ variable) to increment what told to do so (which i believe i have working), at this point i am just assuming its either a bug or something i am doing wrong (probably that). ((Also i turned off the shadow on the text as that is what i initially thought it might be??)) Here is what i have for the blueprint of it.

1c05b304d80d7c4879b9f2916484d823.png

Thank you!

Bind your text var directly to hud’s WaveText widget.

Setting your plain text var from anywhere will automatically update the widget the var is bound to.

See if it helps.

Thanks for the help, however now the number text is no longer updating, but the ‘‘Wave:’’ is doing what i couldnt remember how to recreate, which is sort or creating a copy of the text behind it.
ce68befe5fbb06dfea6d2b3290dc409b.png
Here is what i did in case i set it up wrong.

Thanks.

I assume because everytime you construct the widget its setting the text. How many times are you constructing it during runtime? Just once? SetText is a way of setting a textblock from another class, its the improper way to do things IMO. You should have 2 text blocks in something like a horizontal box and set the second one texts’ bind to a new function which returns the value you want. Then contruct the widget and it will constantly show the value.

Hees an example of a binding that sets a text block to an item name from a structure.

2 Likes

Nsomnia’s method (and the camelback Hungarian notation) makes perfect sense - that’s the pro way; it might complicate things a little if you need to set 50+ text fields and does require extra work.

At least get rid of this (in the constructor as well) and make sure you spawn the widget only once. I am under the impression you do it in a loop and end up with overlapping text.

Also, from version 4.7 (I think) you can bind a *string *and text variable directly if it’s a part of a struct, even if it sits in a struct of a referenced object.

Thank you for this, it is no longer doing the duplicating of the text, however now as soon i start the level, the text increments fast and immediately (like up to 150 in 2 seconds), whereas i want it to just add 1 only once and only when i call it to do so from a different blueprint. Any ideas? This is my blueprint function.

And how i am calling it to update.

Thank you.