//Jimmy Vegas Unity Tutorial //This script will make your door open in your cave var DoorSwing : GameObject; var TheKey : GameObject; var KeySound : AudioSource; var CreekSound : AudioSource; var ThisObject : GameObject; function OnMouseDown() { ThisObject.GetComponent("BoxCollider").enabled = false; TheKey.SetActive(false); KeySound.Play(); yield WaitForSeconds(0.5); CreekSound.Play(); DoorSwing.GetComponent("Animator").enabled = true; yield WaitForSeconds(0.99); DoorSwing.GetComponent("Animator").enabled = false; }