transform.parent for individual object

Hello, I have a prefab that spawning in the scene with a rigid body sleeper script on the child. But When I run this code it affects all my prefabs in the scene. I want to affect only its local parent. any suggestions?

using System.Collections;
using UnityEngine;

public class RigidSleeper : MonoBehaviour
{
    private Rigidbody rbGO;
    
    public float timer = 5 ;
    bool setgo = true;
    public float Yforce = 1;


    private void Start()
    {
        rbGO = transform.parent.parent.parent.GetComponent<Rigidbody>();
    }


    void FixedUpdate()
    {
        

        if (Input.GetMouseButtonDown(0))
            setgo = false;

       



        if (setgo==true)
        {

            

            rbGO.AddForce(0, Yforce, 0);


    }
        else if (setgo==false)
        {
            rbGO = transform.parent.parent.parent.GetComponent<Rigidbody>();
            rbGO.Sleep();
            

            if (Input.GetMouseButtonUp(0))
            StartCoroutine(coroutine());



        }



        IEnumerator coroutine()
        {
            if(setgo==false)
            {
                yield return new WaitForSeconds(timer);
                setgo = true;
            }


        }
}
}

@cinemator, Well, your situation is more complex than you let on! If all you had was one parent and a child, then why does your code do:

   transform.parent.parent.parent.GetComponent<Rigidbody>()  ?

It looks like you are climbing the hierarchy all the way back up to some great-grandparent. If all you prefabs share a common parent, there is no “local” parent.

Perhaps what you mean to do is just:

  transform.parent.GetComponent<Rigidbody>()  ?

I wrote the code like that because my objects is the actually grandson of its parent.

Where do I have to look for to act all prefabs differently from their childs