Hi!
I have been trying to make some simple step sounds for my game. I have tried IEnumerator, loops but nothing have worked!
This is a simple cut version of the script. It still contains the more important things that you need to know.
void Start () {
StartCoroutine(StepSounds());
}
IEnumerator StepSounds(){
while (step == true) {
audio.PlayOneShot(stepSounds[Random.Range(0, stepSounds.Length)]);
yield return new WaitForSeconds(nextStepSound);
}
}
Please tell me what is wrong and what I need to do!
And please post your answer in C#.
Thanks
↧