So I actually respawned the player but I have plans to setup a character selection so I want to use tags instead. I want each character that has a player tag on it to teleport to the spawn point. Im not sure about my code but I’ve been researching though, so I think answers from the experts will give me a boost.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Die : MonoBehaviour
{
public Transform Destination;
public GameObject Player;
void OnTriggerEnter2D(Collider2D other){
Player = (GameObject)GameObject.FindWithTag("Player");
Player.transform.position = Destination.transform.position;
}
}
I actually did it but Im not so sure about the tags cause I still need to set up my character in script. Sorry for my bad english.