Manipulating UI on duplicate actors individually

What I am trying to do.

  • I am making an item that players can spawn in. The item on a screen will display different information like owner name, name of the item, and a few variables that are specific to that player’s item(an actor I guess).

What I am struggling to do.

  • Return values just for that specific item for that player
  • All values are currently shared between all the items

What I have tried.

  • I started by just doing a “Get All Actors of Class” to get the system working for 1 item but I know this will not work and needs to be replaced with another method of getting the correct actor.
  • I thought Arrays might work and just add each new item to an array on spawn? Couldn’t get it working though.

PS: I am new to UE4 sorry for wrong terminology or if this is a common concept.

Hi! Can you share some example? I dont understand where is the problem…

Attached below is a function to get the current status (string) of an actor. How I have it setup is when you hit a button on the UI on the actor it changes the status to something else. If I have 4 of the same actor down it will change the status on all of them instead of just 1.

I know the “Get All Actors of Class” is the wrong way of doing it but I want to know how I can just change the variable on that one actor I’m interacting with.

on that one actor I’m interacting with

Do tell how you’re interacting with it. That’s the key element.

How I have it setup is when you hit a
button on the UI on the actor it
changes the status to something else.

How are the UI elements related to the actor? Each actor has its own widget?

So I believe that I am interacting with the UI with a widget interaction on my FirstPersonCharacter BP.

I have a widget component on the actors. Each actor uses the same widget. But this is eventually going to be something that players can buy from an in-game store and it spawns for them.

318610-screenshot-46.png

Ok, so can you tell me what is right:

  • GetStatus is function of BP_MoneyPrinter1

  • E input is in FirstPersonCharacter BP. I see that you have WdigetInteraction there too. Is it a component? Or variable? If it is variable, where do you set it?

GetStatus is a function of the UI_MoneyPrinter. (not say that is the correct way of doing it.)

E input is in FirstPersonCharater BP.
WidgetIntegration is a component of the FirstPersonCharacter BP.

I put the GetStatus as a function of the UI_MoneyPrinter so I can display “Active/Inactive” on the widget.

Try this

Actually, it seems as if I still can’t access variables just for that one BP_MoneyPrinter1. I am trying to access them in the UI_MoneyPrinter but when I can’t figure out the appropriate Object to attach to the Cast to BP_MoneyPrinter1