There is no way to create a Set in BP

Try it out, we’ve got all the boolean operators, but we can’t use the set because we simply can’t just add or remove from a set, nor create one…
This is dumb.
Icing on the cake, we can’t convert Arrays to Sets.

Hey Moddingear. What version of UE4 are you using? I think the Set features were fully implemented in BP in 4.15. Before then you could create Sets in C++ and had some limited ability to use them in BP, but they weren’t really a complete BP feature. If you’ve not seen it there’s a breakdown of all the Set nodes on YouTube.

With regard to converting Arrays to Sets - I think you can run a for each loop on the Array and add each element into a Set, which will do pretty much the same thing.

There is an AddItems node that adds an array of items to the set. If you have cleared your set before you have converted an array to a set.

See for yourself.


Drops microphone

I hadn’t really used Sets so needed to get back home before replying again. On 4.15.1 (what you’re on) there are Add, Remove and as Pepeeee said add from array nodes all available.

Set.jpg

Compared to arrays a ‘Make Set’ node is is missing from the Set functions. Other than that I think all the expected functions are there.

I actually couldn’t track down the node in your picture so not quite certain what that is, but I get similar results when dragging back from a set variable node when the variable is a Set. Context Sensitivity seems to demand that you get access to the functions by getting the Set variable and dragging forward off it, not by dragging back from a set node.

Yes, that is the only thing that is stopping me from using them. Actually you have to make a variable to use them, and you can’t directly make a set from an array.

Ah I see, yes that’s the main limitation I think. I agree it would be useful to see this added to the engine.

So we gonna have this feature in 4.18, October 2017 :wink:
https://github.com/EpicGames/UnrealEngine/pull/3457

What do you need a make for?
If it is *stopping *you and you need it for-

  • Empty, then create a set of that type and just have an empty dummy set.
  • Const Set, then do the above but add members to it. And now you can add members to it in the details panel instead of jumping into the blueprint nodes.
  • Doing some fancy selection logic, then do the first above, add the selection to that set.
  • Other, then I don’t know but I bet it can be solved. I mean, better than being stopped, right?