Getting Child Objects

How in code to do I get the child object and see if there is a customer on that game object? Current I made a path for customers to follow but I want to see if there is a customer on the sphere, if there is then wait behind the customer and on the other sphere
Sphere2

  • You can make one global script referencing your customers and your spheres to know which customer is assigned to which sphere.
  • You can also make a script on each sphere disabled by the customers and enable by the customer when they leave.
  • You can use OnTriggerStay() on each sphere and let each sphere detect if it is overlapped by a customer.

The 1st one the better in my opinion but the harder as well.

Hey haadikhan32!

I would make a “waiting-line manager” object, with a script. Add a list of GameObjects for the target points. Make customers ask the manager where to go. Depending on free positions, the manager tells the customers to go to a specific position, by returning the sphere position.

Hope this helps!