Get All Actors of Class array is being populated wrong

I am having an issue with an array, using the get all actors of class. It is returning all the actors, but the array is populated with the 4th member as the first item ( [0] = playerStart4, [1] = playerStart, [2] = playerStart2, [3] = playerStart3).
The first time I run it when i open the editor it fills the array properly, from playerStart - playerStart3, after that every time I run in the editor it fills it the other way. Any ideas why this would happen?


Get All Actors of Class does not currently support sorting actors, so it will grab them in a non-sorted order. The only way to sort the array would be to use the Make Array node and populate the array with references to your player controllers in the order you’d like.

Have a great day,

Sean Flint

Object iterators does not really guarranty you the order of objects, controlling order by order of creation is also not comftible in design state point. Or else i don’t know something and it’s really a bug :stuck_out_tongue:

Best practice is creation of own PlayerStart class (blueprint?) and make ID varable and then using ChoosePlayerStart function override in GameMode implement correct PlayerStart picking depending on how you want to do it