Reversing an array in BP

Hello everyone,

For my game that I am making I want to make a spawning system which depends on distance to the players, I can sort the distance from the spawns to the player. But I want to reverse the array so that I can easilly add a weight to it. With this weight I then can calculate how many enemies spawn on a certain spawnpoint.

EDIT: Note the difference between player and playerS

But how do I reverse an array in blueprints?

Thanks in advance,

Found my own answer:

for(int i = 0; i < validData.length / 2; i++)
{
int temp = validData[i];
validData[i] = validData[validData.length - i - 1];
validData[validData.length - i - 1] = temp;
}

that’s the same answer I was going to give you. either way, I’m glad you got it resolved!

Shouldn’t that be
for(int i = 0; i < validData.lastindex / 2; i++)