2023-05-12 15:25:59 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class respawn : MonoBehaviour
|
|
|
|
{
|
2023-06-21 16:54:02 +02:00
|
|
|
private GameObject player;
|
|
|
|
[SerializeField] private Transform respawnPoint;
|
2023-05-12 15:25:59 +02:00
|
|
|
|
|
|
|
void Start()
|
|
|
|
{
|
2023-06-21 16:54:02 +02:00
|
|
|
|
|
|
|
player = GameObject.Find("Frank");
|
|
|
|
|
2023-05-12 15:25:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnCollisionEnter2D(Collision2D other)
|
|
|
|
{
|
|
|
|
if (other.gameObject.CompareTag("Player"))
|
|
|
|
{
|
|
|
|
player.transform.position = respawnPoint.position;
|
|
|
|
Debug.Log("Respawn: Move");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|