Why does this not work? I'm trying to get the sound effect before the visual, but I don't hear it until I move away from the location. This is part of a routine that is called from Update on the Player. Thanks in advance for any hints.
if (carriedObject.name == "HandTorch") {
float d =findNearest (o.transform);
if (d < 0.5f) {
ASource.clip = woosh;
ASource.Play ();
float duration = woosh.length;
StartCoroutine (WaitForSound (duration));
o.transform.Find("Flame").gameObject.SetActive(true);
o.transform.Find ("MyTorch").gameObject.SetActive (true);
}
}
}
public IEnumerator WaitForSound(float duration)
{
yield return new WaitForSeconds(duration);
}
No comments:
Post a Comment