(Awnserd)How to get a transform of an instantiated gameObject and use it in another script

how could i assign a instantiatet gameObject as public and change his transform. I made this script but i get a nullRefrence exception becouse my “SpawnPositioning” script is tryng to change the transform of my scriptableobject and not the object i instantiated in my “BuildSlot”

here is my BuildSlot script(my Build slot scrip should instantiate the gameObject wich is declared in my Scriptable object and this script works fine)
using System;
using UnityEngine;
using UnityEngine.EventSystems;
public class BuildSlot : MonoBehaviour, IPointerClickHandler
{
private SpawnPositioning spawning;

	public BuildingObjects[] buildObject;
	public BuildSlot[] slots;

	public event Action<BuildingObjects> OnRightClickEvent;

	protected BuildingObjects _object;
	public BuildingObjects Object
	{
		get { return _object; }
		set
		{
			_object = value;

		}
	}
	void Start()
    {
		//set the Item at the Start
		BuildItem();
    }

	public void Awake()
    {
		//finds script
		spawning = FindObjectOfType<SpawnPositioning>();
    }


	public void BuildItem()
    {
		//set Item
		foreach(BuildingObjects buildingObjects in buildObject){
			ItemAdd(buildingObjects.GetCopy());
        }
    }

	public virtual bool ItemAdd(BuildingObjects buildingObjects)
    {
		//declare Object to the gameObject 
        for (int i = 0; i < slots.Length; i++)
        {
			if(Object == null)
            {
				Object = buildingObjects;
				return true;
            }
        }
		return false;
	}

	public void OnPointerClick(PointerEventData eventData)
	{
		// instantiates gameObject
		Instantiate(Object.objectToBuild, transform.position, transform.rotation);
		//set the bool to true so the object can follow the position you are looking at
		spawning.Selection = true;
	}

}

here is my SpawnPositioning script(This should change the transform of my gameObject wich i instantiated before)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpawnPositioning : MonoBehaviour
{
    public Transform Testing;

    public GameObject Test;
    public BuildSlot Objects;
    public Camera gameCamera;
    public bool Selection = false;
    
    void Update()
    {
        // checks if the bool is true
        if(Selection == true)
        {
            SelectBuildPosition();
        }

    }

    public void SelectBuildPosition()
    {
        //rayCast the position
       Ray ray = gameCamera.ScreenPointToRay(Input.mousePosition);
       RaycastHit hitInfo;

       if (Physics.Raycast(ray, out hitInfo))
        {
            // set the transform of the object to the raycast position
              Objects = FindObjectOfType<BuildSlot>();
              Objects.Object.objectToBuild.transform.position = hitInfo.point;
               

         }
        
    }
}

and if needed, my scriptable object script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Text;

[CreateAssetMenu]
public class BuildingObjects : ScriptableObject
{
    public string ObjectName;
    public GameObject objectToBuild;
    public Transform objectsTransform;

    public virtual BuildingObjects GetCopy()
    {
        return this;
    }

}
sorry for my bad english btw.

i fixed it, i just needet to make in my BuildSlot an public GameObject and declare it when i instantiate my object testing = Instantiate(Object.objectToBuild, transform.position, transform.rotation) as GameObject;