Yes, this update event is working for print string but also for my get text binding. This is strange because I did try events previously among the other communication methods with no success. I will test a bit more but I think you may have solved it, nice job!
It should work exactly like you originally expected, though. Now I won’t be able to sleep. If you ever crack it, do tell!
Good luck.
Unless I’m mistaken:
My testing shows that this works with new widgets reliably.
If for an old one I use the event method they only accept the print string but no bindings. I would blame the bindings, but if after seeing it I then replace the event float with a cast one they suddenly work fully, string and binding, no other changes. Refreshing or not.
Bizzare.
Can’t find any difference.
A solution is to just remake the old widget, shame but works and potentially easier.
Either we say this is solved or do you want to figure it out further?
Nah, it’s fine. I’ll find something else to obsess about
Hey I searched > found this because I have a Widget problem too.
- My Widget would not work to [Set Text] by using its Bind > Get Text (Function) nor set the variable [given by a BPI comm link] - unless I pulled the variable from a CastTo (Player).
** Error: it looked like a “new widget” copy (with the new Text) was laid over the “old widget” text - when my code was not supposed to make widget copies??? - merely update the existing Text. - Yet the same widget would work to [Set the same text asset’s COLOR] by using a Bind for Color and Opacity > which DID work when the color variable was [given by a BPI comm link] - and thus I did not need to use CastTo (Player).
- This was confusing and annoying. So I tried your idea of making a new widget. I tried not to copy/paste all code from old widget (copied only some). But use the new widget’s existing Return nodes (when I remade the Binds).
- And this still did not work!
So then I made a new project with intention to post the fresh asset here, for people to test. I used a vanilla Character BP, but Migrated my BPI and “widget remake” (which did not work) > to this new project. Then in CharBP [BeginPlay > added this widget to viewport].
- Now the widget’s BPI code worked to set the TEXT and COLOR, without using CastTo.
- So much of my time has been wasted, so I’ll post pics later. But something is wrong with widgets/UMG in UE4.27.
WidgetBP (working code):
CharBP:
Widget_Test4P.uasset (199.6 KB)
Widget_BPI.uasset (11.8 KB)
- I also learned that Binds in widgets repeat like Ticks??? Why?
** During testing I added a Print to make sure that my Bind was getting triggered - when the code was not working as expected in the old project.
** Then after migrating the same asset to the new project, the Bind worked, and now I saw the Print repeating like a Tick.
** Which proves to me dont use Widget Binds (Functions) and instead use SetText in the main “Event graph” of widgets.
#Unsolved Widget Mysteries.
- Also why is this website auto converting large res PNGs to JPG? Makes them unreadable > wastes time > forces me to cut them in half and post as two PNGs.
It’s too difficult to read old post pics which were in low res, before the free Blueprint PNG maker existed (saves selected code at 100% zoom even if too big to fit on screen).
Unless WidgetTestFresh is of type UserWidget you already have a variable of the type of the widget and since a soft class variable of a parent class is not being used the Create Widget node returns a variable of the spawned widget type same as a cast node would… What purpose serves the inteface?
Thanks. Should I make my own thread with details? (I thought I had a UMG bug similar to OP’s issue. I read 3 threads with similar unexpected issues; so I posted my findings.)
It is a HUD-widget (always on screen) merely to display (for the player) the current key binds and the status of a Bool var in Player’s BP.
- So I only need 1 copy at a time, only displayed to Player 0, reuse or refresh it if Player 0 Possesses another copy of CharBP. What setting do I need for that?
- The reason that I declared the Widget as a variable > is to later have a reference of it, to delete/remove it from screen (if Player no longer controls that copy of the CharBP), or to update what another copy’s HUD displays - when Player 0 Possesses that copy.
- During my Possession code, I do a [not Cast method] into the [new body CharBP to control] > to attempt to push my Char’s current Bool value > into the new body - so that I only need 1 HUD displayed at a time. (Code not show, thus perhaps why I should make a thread since OP has been solved.)
Im making something for someone to improve the HUD widget.
- At first I modified their widget to add my code (in a new project I made). But I was getting UMG bugs?
- So then I added my code to a vanilla CharBP, and still got the UMG bugs that I posted prior (And this was without switching Characters.)
- Then the bug was fixed when I migrated to a new project.
- Now that the UMG code works to pass my bool from CharBP to Widget, I am working on the Possession code. And now I have a problem with copies of the HUDS being made instead of only one. In my Parent CharBP, I even put a check [If not Player controlled > dont make the widget on BeginPlay]. But this fails > when I possess the new Char, they have no widget at all; and somehow the existing screen HUD that was created for my Player, stops working when I possess the new body.
** Something wrong with the setting for who owns the Widget?
This could help: https://www.youtube.com/watch?v=7b7a20j0azc