using System.Collections; using System.Collections.Generic; using UnityEngine; public class DoorPuzzleScript : MonoBehaviour { public GameObject KeyHeld; public GameObject Key; public GameObject Door; private void Update() { if (KeyHeld == Key) { // Opens Door Door.GetComponent<Animator>().SetTrigger("OpenDoor"); } } }