Controleert de Key op de deur zodat de deur opengaat.

using UnityEngine;
using UnityEngine.Playables;
 
public class CheckKey : MonoBehaviour
{
    [SerializeField]
    private PlayableDirector timeline;
 
    private void OnTriggerEnter(Collider other)
    {
        // Check if the colliding object has the "Key" tag
        if (other.CompareTag("Key"))
        {
            // Play the timeline
            if (timeline != null)
            {
                timeline.Play();
                //destory key
                Destroy(other.gameObject);
            }
            else
            {
                Debug.LogWarning("Timeline is not assigned to the LockKeyInteraction script!");
            }
        }
    }
 
}