I have a problem with a text that does not update the data I supply to a text in my UI Widget.
I have an actor that generates a number that number.
I have added a cast to, although I put a note that it is not necessary, but when it does not have the cast and I call that actor with a variable, I get an error that is empty … so I leave it with the cast to.
When I put it with cast to, the text box disappears on the game screen and does not update. If I don’t put the cast to it gives me the error that it is empty and if it is shown and I don’t know why it doesn’t update, I pass you images of the code.
According to your screenshots, you never set the variable Planet inside your Widget, so it’s Null. The cast works cause even if it’s null the class is the same.
After Create UI Widget, before adding it to Viewport, set its Planet variable to Self.
Target is UI, your widget reference. Just drag a cable from the UI variable and type “Set Planet”, the node option should appear there.
I use Self because you’re creating the widget from the Planet Blueprint, so you would be assigning the same Planet reference that’s creating the widget as the widget’s Planet variable’s value.