}                                                                                     // passed to trigger node to direct to next function

    public void TargetReached(GameObject target)
    {
        if (target.CompareTag("Waypoint"))                  // is it a waypoint?
        {
            if (target.transform == controller.GetTarget()) // is it the right waypoint?
            {
                ai.TargetReached(target);
            }
            else if (target.CompareTag("Temporary"))
            {
                Destroy(controller.tempObject);
                TargetReached(controller.originalObject);
            }
        }
    }