Files
DropToTheRoots/Game/Assets/Scripts/HoleDeath.cs
T
2026-06-07 10:01:22 +02:00

15 lines
346 B
C#

using UnityEngine;
public class HoleDeath : MonoBehaviour
{
public GameObject targetObject;
void Awake()
{
targetObject = GameObject.FindGameObjectWithTag("Player");
Destroy(targetObject);
// This tells Unity NOT to destroy this object when loading a new scene
DontDestroyOnLoad(gameObject);
}
}