How do I access a variable by casting from a blueprint to a UI widget?

Not quite sure if the question I asked made any sense but to clarify what I am trying to do is:

Access a variable in a blueprint class called CB_BuildingAsset in my ui widget to change a progress bar. I can not get it to work here is what I have

The variable I am trying to access is the people one you see below to display using a progress bar on the player screen. Not sure what to plug into the object as I think I am on the right path maybe with the cast to CB_BuildingAsset as the variable I want is in there.

Casting is not a form of communication. It’s conversion. You can’t find things with casting. In order to Cast, you need an object reference first.


Access a variable in a blueprint class
called CB_BuildingAsset

That’s not what you need either. You need an instance of an object, not its class. If you wanted a class, you’d:

349870-screenshot-3.png

But that does not give you the access to the instance, of which there may be many.

Not sure what to plug into the object
as I think I am on the right path
maybe with the cast to
CB_BuildingAsset as the variable I
want is in there.

Is there only one? Are there more? How is the editor supposed to tell which of the 10 (let’s say) you’re trying to access? How do we know which one to choose? Are we clicking things, looking at them, getting close to them? Think about a method / trigger that communicates that choice.