My random element from array is always 0

Hello,

I’m making a train game where trains spawn in and head to a random destination using a navmesh. For some reason, occasionally and sometimes consistently my BP for selecting the winning destination, which is random from an array of all the “destination” collision box actors will be 0 making it impossible to win. Any advice would be appreciated :slight_smile:


I think random is called twice here

It’s better to choose one, put it in a variable, and then work with it.

Thank you for the suggestion. I have since re-written the whole thing and it seems to be working better.

1 Like