How to get AI characters to form a queue?

I’ve been wrestling with this for a few days. It’s something that seems so simple but it has been proving to be very difficult for me.

I have AI going to a spot when certain conditions are met. They currently all crowd that spot. What I want them to do is to form a queue instead that will automatically move forward when the pawn in the 1st position leaves and will move forward to fill spots whenever any AI leaves their spot in the queue.

The solutions I’ve come up with so far are absolutely horrendous and, frankly, don’t work. What would be the best way to handle something like this?

I’d recommend playing around with the idea of setting up a blueprint interface that would allow the ai to send a query to the target object you want them to go to, if its a spot make it an object at that spot. the ‘meeting point’ can respond back if a que exists and if so provide them with a location to stand while it waits. this also allows the ‘meeting point’ to begin forming an array of whos asked, and in what order, to meet there if they need to do something like go through grocery checkout, use a pay phone, etc.

You can handle how to generate those however you’d like on the meeting point end, all that matters is you now have the references to the ai and can update and inform them how to act as you’d like.

I would set up a Formation blueprint of some sort that had some subclasses like Line, Grid, Wedge, whatever formations you need. Then set up origin location, some spacing information, array of actors in the formation and other parameters in the Formation class. In the subclasses, set up a system of intervals and directions for how actors should be arranged in that formation.

Once the formation actor is created in the world, the AI controller can look for it, attach the actors that need to go there in order into the array and have them move to that spot. Once they are all there, have them all face the forward vector of the origin.