How to get a GameObject from another GameObject

I have a prefab, and i Want to access this prefab object from another object

the scene hierarchy has:

  • Player
  • Camera
  • Background
  • Floor(Prefab)

and the prefab hierarchy has:

  • Floor

  • DeleteTrigger

  • CreateTrigger

  • TransformReference

    public class LevelGenerator : MonoBehaviour {
    // Start is called before the first frame update

     [SerializeField] private GameObject FloorRef;
     private void Awake()
     {
         GameObject g = FloorRef.Find("Floor")
         Instantiate(FloorRef, new Vector3(10, 0), Quaternion.identity);
     } 
    

}

Solved:

To get the reference of another hierarchy tree, I need to use the transform of the object in scene’s main hierarchy; so I just take as: FloorRef.transform.Find(“”)