Specifing a gameObject to transform.position

Hi, I’m trying to move a separate gameObject when the player enters and exits a trigger zone. I modified a tutorial, but realized the script is moving the trigger zone and not the gameObject I want to move. I can’t figure out how to make it move a specific gameObject. Any advice?

#pragma strict

var doorTrigger : GameObject;

var originSpot : Transform;
var destinationSpot : Transform;
var speed : float;

function OnTriggerEnter(col : Collider)

	if(col.gameObject.tag == "Player")
		Debug.Log("Entered the collider.");
		transform.position = Vector3.MoveTowards(transform.position, destinationSpot.position, speed);

function OnTriggerExit(col : Collider)

	if(col.gameObject.tag == "Player")
		Debug.Log("Exited the collider.");
		transform.position = Vector3.MoveTowards(transform.position, originSpot.position, speed);



Each component belongs to a game object, and each game object has a transform.
From any component, such as the players collider, you can access the players transform.

col.transform.position = ... 

// which is kinda the same thing to say as this, to tie it back to what I said
// but please prefer the above version as it's cleaner to read :)

col.gameObject.transform.position = ...

Make a Transform variable and use that to reference the object you want to move.

var someObject : Transform;
someObject.position = ...