Hi, i’m making a game and i made a simple item system where you have 3 items to choose from using numbers on the keyboard. Theres a system that gives the UI widget blueprint to change the text on screen to show what you’re holding. The worst part is it used to work but now it refuses to. The text doesn’t change and from the log we can see that the widget can’t use the texts reference:
I’ve set the text object as a variable just to clarify.
Please help!
Hello! It’s a little hard to help with just the error in the message log since it just seems to be returning none for the variable, but you say you’re setting it.
Do you know when this started? What BPs or code you may have adjusted to cause this not to work. Usually, even if it seems unrelated, something changed that affected how the process is going.
I also suggest using breakpoints in the BP to see when you are setting the variable, and when it is being called by the Widget to see if it’s actually happening, even if your logic seems to make sense.
I could possibly trace back a little more if I could see your BP logic of how it is supposed to work but I think this is the most I can do now.
Hi.
How are your Blueprints communicating? Are you using Event Dispatcher, Direct References, or a Blueprint Interface? Whenever I see that error, I just think there is a breakdown in communication somewhere along the line. For mysterious reasons, some times the BPs, esp with the Widget BPs, the communication can breakdown. Can you try another method of BP communication between the widget BP? For instance, if you are using an Event Dispatcher, can you try using a BP Interface instead?
Interesting. And just to clarify and make sure, when this widget is being created, the textblock object is there, correct? Just not updating the text based on your function?
If it’s not there at all, then something is removing it, which is why the variable is accessing none.
That’s like that for any text block variable so I don’t believe your problem resides with it having none as the default.
Not really an actual solution but sometimes things get corrupted, you could try recreating the variable under a new name and resetting the connections in your BP just for the sake of sanity. I’ve definitely had that happen once before.
Otherwise, I’m not quite sure what the problem may be.
I did make a whole anoter widget blueprint to see if it was just a problem with the original one but it didn’t work either. Must be either a bug that corrupted the whole project or an user error. Ill try making a different project to see if it works.
It works but not because it’s a new project. When i wanted to call the refresh I used “GameUI object” reference in the player blueprint,. When i swapped it out to “Get all widgets of class” reference it started working again. The worst part is that with the GameUI object reference it did call the event node in widget blueprint but couldn’t set the text I guess. There was no way for me to know that that was the issue but I went back and tried to remember what could I have done that broke it. Thanks!