Files
2026-02-18 00:08:49 +02:00

32 lines
633 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyPickup : MonoBehaviour
{
public static bool HasKey = false;
[SerializeField] private GameObject pickupEffect;
private void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player")) return;
HasKey = true;
if (pickupEffect != null)
{
GameObject effect = Instantiate(
pickupEffect,
transform.position,
Quaternion.identity
);
Destroy(effect, 3f);
}
Destroy(gameObject);
}
}