Respawn upon hitting a Collider/Trigger in C#.

I’m trying to set up a basic respawn script. I need the player to return to the spawn point after hitting an object. The problem is, it’s been a long time since I had to deal with spawning codes so I’m kind of just flailing around trying to get something to work.

private Transform respawnPosition;

void Start()
{

respawnPosition.position = GameObject.FindWithTag ("Spawn");

}

void OnTriggerEnter (Collider other)
	{
		if (other.gameObject.tag == "Top")
		{
		this.rigidbody.isKinematic = true;
		falling = false;
		}

		if  (other.gameObject.tag == "Platform")
		{
			transform.position = respawnPosition.position;
		}
	}

The main errors I’m getting is obviously that I cannot implicitly convert type Transform to GameObject and I cannot implicitly convert type GameObject to Vector3. (The current error for the code I provided is the Cannot implicitly covert type GameObject to Vector3).

I know it’s going to be incredibly simple, I look at this and I KNOW it’s simple, but for some reason I can’t seem to figure it out.

EDIT: The kinematic and falling stuff is not important to this problem I don’t believe, I simply copied the entire OnTriggerEnter code from my script.

respawnPosition.position = GameObject.FindWithTag (“Spawn”);

Spawn is a gameobject, no?

so shouldn`t you do something like this instead ?

respawnPosition.position = GameObject.FindWithTag ("Spawn").transform.position;?

Change:
I’m not sure if you can create an instance of Transform on its own… So you should just have a Vector3 called spawnPoint and set it like this:

Vector3 spawnPoint;

void Start()
{
   GameObject spawnObject = GameObject.FindObjectByTag("Spawn");
   spawnPoint = spawnObject.transform.position;
}

Then, when the player dies:

if  (other.gameObject.tag == "Platform")
{
    transform.position = spawnPoint;
}

Edit: You can’t make a transform, but you can store one.