Code (JavaScript): var triggered = false; function Update() { if(triggered == true) { StartCoroutine(WaitCoroutine(1)); } if (distance <= 3) { sanityGUI.currentSanity = sanityGUI.currentSanity + sanityDamage.scarePercent; triggered = true; AudioSource.PlayClipAtPoint(ScareSound, enemy.position); } } I want to make a proper coroutine, but I can't figure out how. Can anyone help me here?
Well, I'm not sure what you're attempting. Update isn't a coroutine, so there's that issue. Check out the docs, then come back with a more specific question: http://docs.unity3d.com/Manual/Coroutines.html