private void Update() { //activate if (Physics.CheckSphere(this.transform.position, 0.45f, activator)) { Collider[] hits = Physics.OverlapSphere(this.transform.position, 0.45f, activator); foreach (Collider coll in hits) { print(coll.name); } if (!active) { door.UnlockDoor(); //start secParticleSys if (particleScript != null) { particleScript.StartSecParticleSys(); } //Post Sound PlayEvent m_SoundEvent.Invoke(this.transform.position, m_maxDistance); active = true; } } else //inactive { if (active) { door.CloseDoor(); //stop secParticleSys if (particleScript != null) { particleScript.StopSecParticleSys(); } active = false; } } }