Jump Scare Unity 5

I have set up a jump scare for a horror game I’m working on. When the player passes through the trigger the jump scare appears.

After it appear I have the jump scare to remove itself after 2 seconds. The jump scare begin to flicker on/off. Can anyone share some insight for the jump scare not to flicker and just complete remove it’s self from view?

Here’e my remove code:

function removeOverTime () {

yield WaitForSeconds (0.8);
ghost.GetComponent.().enabled = false;

}

It’s probably still being turned back on repeatedly by whatever script is activating it initially. maybe just SetActive(false) the whole gameobject just in case?

1 Like