How to retrieve the prefab clone into the script when it is instantiated?

I am trying to create level prograss bar, here is the script to fill the Slider along with ball when its moving towards finish line , here finish line is prefab clone which is randomly instantiated at different position. but as expected finishTransform using position(0, 0, 0) from prefab not from the clone. how can i retrieve the clone into the script when it is instantiated? here is the Progressbar Script :

    [SerializeField] Transform ballTransform;
    [SerializeField] Transform finishTransform;
    [SerializeField] Slider slider;

    float maxDistance;

  

    void Start()
    {
        maxDistance = getDistance();
    }

    void Update()
    {
        if (ballTransform.position.z <= maxDistance && ballTransform.position.z <= finishTransform.position.z)
        {
            float distance = 1 - (getDistance() / maxDistance);
            setProgress(distance);
        }
    }

    float getDistance()
    {
        
        return Vector3.Distance(ballTransform.position, finishTransform.position);
    }

    void setProgress(float p)
    {
        slider.value = p;
    }

Here is the Platform script where i instantiated the finish line

GameObject finalPlatformInstance = Instantiate(finalPlatform, transform);
        finalPlatformInstance.transform.localPosition = new Vector3(0, 0, spawnPosZ);

hi @Humansquirrel You could try using

instance.transform.Find("obstacles").Find("O1").position;

@Humansquirrel If you want to get the reference of the gameobject/clone present in a scene. Then just add tag to the object (say “FinishLine”) and then:

Public Transform finsihtransform;
Void Start()
{
  finishtransform = GameObject.FindObjectwithTag("FinishLine").getComponent<Transform>();
}

I hope I haven’t misunderstood the question.