shopping-cart-sim/Assets/Scripts/KeyPickup.cs

17 lines
331 B
C#
Raw Normal View History

using UnityEngine;
public class KeyPickup : MonoBehaviour
{
public static bool hasKeys = false;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
hasKeys = true;
Debug.Log("Picked up the keys!");
Destroy(gameObject);
}
}
}