revival/game/Assets/Scripts/Death & Respawn/DeathZone.cs

14 lines
385 B
C#
Raw Normal View History

using System;
using UnityEngine;
public class DeathZone : MonoBehaviour
2021-03-12 12:52:56 +01: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 18:41:34 +01:00
if (other.TryGetComponent(out PlayerDeath playerDeath))
{
playerDeath.Respawn();
}
}
}