using System.Collections; using System.Collections.Generic; using UnityEngine; public class TriggerDoor : DetectionZone { public string DoorOpenAnimatorParamName = "DoorOpen"; public static bool ableToOpen = false; public static Animator animator; void Start(){ animator = GetComponent(); } void Update() { if(detectedObjs.Count > 0) { //if (Input.GetKeyDown(KeyCode.E)) //{ animator.SetBool(DoorOpenAnimatorParamName, true); ableToOpen = true; //} } else { animator.SetBool(DoorOpenAnimatorParamName, false); ableToOpen = false; } } public void triggerDoor() { animator = GetComponent(); animator.SetBool(DoorOpenAnimatorParamName, true); } }