Cooking game, where the customer come and stop on the right place?

**How do I move the red box directly to the left with the condition that the red box would stop on the lowest white box variable order?

so imagine the red box is a customer.
and the white box is a place where the customer stops moving from the left.
I created a variable named “order” on the white box and set the number 1 in the middle, number 2 on the left, and number 3 on the right as the picture I provided. so the order is not linear.

What is the expected result

it’s like a cooking game where the customer comes in and stops at the empty place but in order from the middle, left, and right.
it keeps coming whenever the place is empty because the player serves all the customer orders.

What is the actual result

I don’t have anything in mind, so I asking for others to help with this logic

Related screenshots

thanks

These are similar.

https://forum.gdevelop.io/t/solved-npc-empty-seat-detection/60134/2

https://forum.gdevelop.io/t/solved-help-with-the-logic-of-choosing-an-empty-table/42826/4?u=keith_1357

The main idea is to use an object variable named empty with a default value of true for the spaces.

Space Object variable empty is true
Pick object nearest object to center position or wherever
(you can use numbers or use the X, Y of a target object)

You then add a customer, set the picked space’s empty variable to false and move the custumer to the space.

Setting the space to false prevents the next player from using it. It also prevents the spawning of a customer is the spaces are all taken. You can add a timer to space them out.

When the customer leaves, you set the space’s empty variable back to true using customer is in collision with to pick the space.