using System.Collections; using System.Collections.Generic; using UnityEngine; public class Trigger_Light : MonoBehaviour { public GameObject obj1; private void Start() { obj1.SetActive(false); } // Start is called before the first frame update private void OnTriggerEnter(Collider other) { transform.parent.parent.SendMessage("Audio_lamp"); obj1.SetActive(true); } private void OnTriggerExit(Collider other) { obj1.SetActive(false); } }