14 lines
385 B
C#
Raw Normal View History

using System;
using UnityEngine;
public class DeathZone : MonoBehaviour
2021-03-12 11:52:56 +00:00
{
private void OnTriggerEnter(Collider other)
{
// Checks to make sure other collider is the Player. Sets player variable as Player game object and starts the coroutine.
2021-03-12 17:41:34 +00:00
if (other.TryGetComponent(out PlayerDeath playerDeath))
{
playerDeath.Respawn();
}
}
}