Add a gameobject/transform present in a scene to a script on runtime

Hi, so my question is not about getting code, I want to know if this is possible and what command can I use. The problem is this one, I have instantiated a gameobject in the game but it uses a script that uses a gameobject or transform that was already in the game scene. I tried using the prefab for the transform but it doesn’t work, I need to use the one already present in the game scene, so I am wondering if I can assign it to the script variable after I have instantiated this gameobject.

If I understand your question correctly, this is the typical way for an instantiated object to initialize a variable from another game object in the scene.

private var player : Transform;

function Start() {
    player = GameObject.Find("Player").transform;
    // or 
    player = GameObject.FindWithTag("Player").transform;