How can I make a widget interact with multiple of the same blueprint?

The fastest, yet not the best way, to handle this would be to use the Get All Actors of Class node. Put the class in, do a for each loop on the result, and perform whatever outfit changing shenanigans you need on all of them.

This is expensive and shouldn’t be done on tick, and if you have a lot of NPC’s then you might see hanging if your game isn’t optimized very well.

A better solution would be to have all of your NPC’s “bind” to an event on your widget. To learn more about how to do this (highly recommended), look up event dispatchers and watch a tutorial on them. You’ll want to call a dispatcher when your widget tries to change clothes, and all your NPC’s will bind to that dispatcher at some point in order to react when it’s called.

Good luck!

1 Like