Is "Max of Float Array" malfunctioning?

Hello everyone,

I have an array of floats called “Money Possessed Given” that will match with a map variable called “Enum Money Map” in order to spawn blueprints with a certain enum value.

My problem is that each time I use “Max Float Array” in order to sort the array.

My enum returning null value for each float under 1.
However if I don’t use “Max Float Array”, enum will work properly.

So is there something I’m doing wrong?
Is there any good way so sorte arrays maybe?

Thanks a lot for help! :slight_smile:

Have you tried to simply use the sort function ?

Sort

Though, in general I’d be super cautious with maps of “floats to something”, because float equality is not really what you may think it is

@GabUECV thanks for your answer, however how did you found this function please?
I’m not able to find it, actually using 5.1.

Actually I am on 5.4, probably it have been added in between ? I don’t know really :slight_smile:

Oh well maybe that’s it haha :slight_smile:

I double checked in the release notes: it have been added in the 5.4

In the 5.4 release notes:

Add blueprint array sort functions for native types. Adds in-place sort functions. Supports options for stable sort and ascending/descending.

1 Like

Thank you then, I’ve just 5 minutes ago pushed my project to 5.4 (not just for that, but other reasons). So after I fixed many visual troubles, I’ll take a look at this and answer here if the problem is solved or not. :slight_smile:

1 Like