How to separate blueprint's indexes and use them on a widget?

Hey all,

I’m making a door blueprint that I want to place x times in my world, but when I click the button to open or close, all of them open or all of them close. Anyone knows how do I separate those instances?

That’s how I coded the widget:

All of them are opening because you are gathering all of the doors into an array and iterating over it opening every door in the array.

2 Likes

Oh I see… And do you know a way to pass this information through like, different channels?

You could retrieve a specific door entity by index. Having the door array → get by copy / reference and pass in the index.

But please do not gather all off the doors every time its an expensive operation.

If you need to use it and you will have a stationary doors (no destroying / instantiating at runtime) then just gather them at begin play and store them to an array variable and access that in your function.

1 Like

Okay, I got able to specify a single door to open by it’s index, thank you! But how do I get the code to know which door’s button I’m pressing to open this specific door?