How to use index in string variables in a blueprint widget , so each of one string have your own index?

How to use index in string variables in a blueprint widget , so each of one string have your own index ?

I have one blueprint actor called “Door”, and one widget blueprint called “Door Widget”

In my “door” BP i have one string variable called “Code” (editable) and a simple door in the components tab.

In my “Door Widget” i have one simple Text Block already linked to one string variable called “Change Me” in the same widget. I have too one INT variable used as index called “Index Of Each Door”.

I have also a variable used as reference to my “door widget” in my “Door” blueprint, and a reference to my “door” blueprint in my “Widget Door”.

What i need: I need to put my “Door” Blueprint in the level, change the value pf my “Code” in the blueprint details, and i need that change reflects on my Text Block in my “Door Widget”.

However, i need to make several copies of the same “door” blueprint in the level, and each of one must have your unique index.

So…below what i have so far (snapshot and a video). I cannot figure out how to implement the use of index and how to auto increase it of each one “Code” or each of one “door” BP in the level. I´m totaly lost.

Video:
[YouTube Video][5]

Anybody…?

For setting a unique index, you could add some code to the Level Blueprint’s Begin Play event that collects all Doors using Get All Actors of Class. Then you loop over the returned array and set the index.

This requires that all doors are already placed in the level when the level is loaded and that you don’t use streaming. If you do, you might be better off with storing the door counter in a Blueprint that’s globally accessible, such as the Game Mode or Player Controller, and increasing the counter every time you use its current value as a door’s index value.

I still don’t understand what you want to do with the string, sorry.

i need to update my string (changing the value) in my widget blueprint, changing that from my blueprint actor using reference to widget in my actor blueprint…(in my blueprint actor details on viewport)