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

20 lines
486 B
C#
Raw Normal View History

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.
2021-03-12 12:52:56 +01:00
if (other.gameObject.CompareTag("Player"))
{
_respawnPosition.Value = other.gameObject.transform.position;
}
}
}