Object Blueprint and Widget Blueprint no talking.

I have a button being pressed on my widget that removes all other widgets and places a new one of its own. It is also supposed to reset a parameter from another Blueprint (BP_MyComputer) in this example. But they aren’t talking to each other. Am I missing a step?

Hey @BlackFolio!

Where are you setting the BP My Computer widget variable? The problem may be that you have the incorrect instance of that variable, or a null reference.

Get back to us with another screenshot of that, if you can! :slight_smile:

Essentially, I have the “IsWidgetCreated” variable defaulted to False. After it is created, it is set to true. But I can’t get it go back to False once the widget goes away.

Right, but in the first image, you have a variable: BP_MyComputer. Where are you setting that variable from in the first post? It has to be set during the runtime.

Like how you’re using “Set Main Computer Widget” in the second image. :slight_smile:

I’m going to honest, I’m not sure what you mean. I am super new to unreal engine, and a lot of this is like learning a brand new language. I’m still learning the jargon, the node connections, essentially the art part of it is the only part I understand. Getting into the coding has been a living nightmare. I’ve been extremely reliant on tutorials and I simply can’t find one on what I’m trying to do. I am not so arrogant as to not admit that I have no clue what I’m doing.

So in the first image, you have a variable: BP_MyComputer.

It has to actively be set as part of the code, because each time you create a widget, it’s a different version of itself, so it needs to know which one to use, even if there’s only one.

You do that through a “Set” node, like you have in the second picture.

Basically I’m trying to find out where this is being done, if you don’t have this somewhere for BP_MyComputer that may be the issue! :slight_smile:

Okay, that makes much more sense. I currently don’t have BP_MyComputer set anywhere. Being that I only have one instance of this, I didn’t think it was necessary. Where would I set it to make sure that it’s being read correctly?

So! On your widget (The one with the VehicleInventoryButton) you will want to start off with “Event Construct”. Event construct is like BeginPlay, but for widgets. From there it will depend. Where is the BP_MyComputer located? What is it exactly? Is it something attached to the character?

What you could do: Off of “Event Construct” you could use “GetAllActorsOfClass” → BP_MyComputer and then “GetIndex” → 0 (0 would be the first index, if there’s only one of these in your scene it’ll guarantee it’s the one you want). Then “Set BP_MyComputer”. It’s not recommended to do this often but in this case should be minimal on the workload.

BP_MyComputer is an object that the player interacts with. It is literally a computer on a desk in the scene that calls up an inventory screen.