2023-05-12 15:25:59 +02:00

25 lines
433 B
C#

using UnityEngine;
public class respawn : MonoBehaviour
{
public GameObject player;
public Transform respawnPoint;
void Start()
{
}
void Update()
{
}
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag("Player"))
{
player.transform.position = respawnPoint.position;
Debug.Log("Respawn: Move");
}
}
}