Im trying to make a respawn point but it has not work cause i always get an error error CS0029: Cannot implicitly convert type UnityEngine.GameObject' to
UnityEngine.Vector3’and when i don’t it does not work i have looked up similar things but nothing can help me i am new so if its a dumb mistake don’t hate pls help. Its suppose to be that when the player collides with the wall it goes back to the respawn point or the empty game object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawn : MonoBehaviour {
private Transform respawnPosition;
void Start()
{
respawnPosition.position = GameObject.FindWithTag ("Spawn");
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.tag == "Player")
{
transform.position = respawnPosition.position;
}
}
}