Example of gameobject waiting
There are lots more was of using this il be using 2 examples here! Drowning and Jumpscares!
Drowing:
add dis on ur water and add a death thingy or a tp on death but yea cool stuff
Jumpscares:
This is the one that i use in my game too lol so hope you like it!(Yes sheeping sheeps horror map uses this script lol)
public GameObject JUMP;
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Player")
{
JUMP.SetActive(true);
StartCoroutine(SCARE());
}
}
public IEnumerator SCARE()
{
yield return new WaitForSeconds(1.25f);
SceneManager.LoadScene(1);
}