revival/game/Assets/Scripts/Checkpoint/SafeZone.cs

21 lines
483 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using Ktyl.Util;
public class SafeZone : MonoBehaviour
{
[SerializeField] private SerialVector3 _respawnPosition;
private void OnTriggerStay(Collider other)
{
// Check if other game object is Player.
if (other.gameObject.name == "Player")
{
_respawnPosition.Value = other.gameObject.transform.position;
}
}
}