All I want to do is set up a system where the player collides with an invisible cube beneath the map (tagged as respawn) and spawns back at a spawn point (tagged as spawnPoint) but what I have now isn’t working. Do I have to include the camera also as the camera is attached to the character?
using UnityEngine;
using System.Collections;
public class respawn : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other)
{
if (gameObject.tag == "respawn");
{
transform.position = "spawnPoint";
}
}
}