Help with cycling through actors in a fixed order?

2 arrays. One for each one player.

So I have a 1 versus 1 board game, and there are 5 actors of type “map camera”. One on each side of the board, and one at the top looking down. Each player starts at the camera facing their side of the board. Each map camera actor has a variable called “camera type”, which is an enum of either front, back, right, left, or top. I want each player to be able to cycle through each camera in a fixed order (i.e. front, right, back, left, top) by pressing one “cycle” button, but I’ve tried a bunch of different implementations of this, and I can’t figure it out. I also wanted the order to change depending on the player, so the player at the front of the board needs to go front, right, back, etc. but the player at the other side of the board needs to go back, left, front, etc. Does anyone have any ideas?

Thanks in advance!

Could you elaborate?

Make 2 arrays with 5 actors in correct order (not much work and easy to do). At beginning of play give reference of array to corect player. Cycle thru array for each player can be same.

But I’m not sure how to get the arrays in the order I want. When I use GetAllActorsOfClass(), it puts them all into an array in a random order.

  1. If so you can ‘sort’ array using locations of actors
  2. or just manualy spawn actors and put them into array with corect order.

Interesting, thanks!