How to make NPC's form a cue?

I was wondering on how to make the NPC’s form a cue (standing on different positions), instead of all being dragged to the same position
Like this

It is kinda hard to explain my exact situation, but I can summorice it all to: is there a command that detects if an objects is in contact with it?

But if you have made things like this before, I would really appreciate if you told me the trick.

(Note that all of the NPC objects I have are in the same group, and therefore all of 'em have the same command, cuz there is a spawner to the right that spawns them)

I finally had a chance to play around with this concept. I tried 2 methods. One using point is inside and the other uses placeholder spaces to define spots in line. These might need tweaking. I didn’t notice any bugs but everything needs tweaks and extra checks and balance. Use as much or as little as you want to.

source: (click the green [code] button and [download zip] then extract and open the JSON file.

try me:

Spawn an NPC using the buttons on the right. The top method uses point is inside. Don’t click too quickly. There’s no check and they can get stacked. The bottom button uses placeholders and it won’t spawn an NPC if there isn’t a free space.

Here are the events. See the project for the variables. Some need to be set to true by default like NPC ans NPC2 IsEntering and Space IsEmpty