//Jimmy Vegas Unity Tutorials //This script will trigger your jumpscare using System.Collections; using System.Collections.Generic; using UnityEngine; public class BZJumpTrigger : MonoBehaviour { public AudioSource DoorBang; public AudioSource DoorJumpMusic; public GameObject TheZombie; public GameObject TheDoor; void OnTriggerEnter() { GetComponent().enabled = false; TheDoor.GetComponent().Play("JumpDoorAnim"); DoorBang.Play(); TheZombie.SetActive(true); StartCoroutine(PlayJumpMusic()); } IEnumerator PlayJumpMusic() { yield return new WaitForSeconds(0.4f); DoorJumpMusic.Play(); } }