Daily Unreal Column #66 - Algo::RandomShuffle
The amount of times I, myself, have been searching for an algorithm that shuffles an array is greater than I would like to admit. But I will never do that again.
Random shuffle function has been added to the engine’s code in version 5.1. Ever since there no need to Google for a different shuffle algorithms as all you need to do is use this function.
Simply call the following:
TArray<float> MyFloats;
Algo::RandomShuffle(MyFloats);
The function takes the range parameter by reference so it modifies it in place instead making copy.