So Basically I am trying to have customers follow a path. The path is just basically the customer walks to the register once he gets his food, he walks out. Now what I want to do is have multiple customers follow the path but as the first customer orders, the 2nd customer waits until its his turn. How do I check if the next sphere in the path is free so once it is free, the next customer in line goes to that sphere and orders. Some pseudo code could help if you have the time
well rn on he start method, when the game object spawns itll look for a path gameobject. if the path is not null then move customer on path, if it cant find the path then itll just say path not found. how can i have it where it just looks for the sphere or next sphere and see if it game object is there?
void Start()
{
orderManager = FindObjectOfType<OrderManager>();
GameObject path = GameObject.Find("Path");
if (path != null)
{
pathTransform = path.transform;
}
else
{
Debug.Log("Path not found");
}
}
public void MoveCustomer()
{
//This is called when the customer spawns in which tells them to move along the path
Debug.Log("Moving customer forward");
isCustomerEntering = true;
}