I'm having trouble adding a wait in c#. This is my setup.
//This method is calld by Update()
private void introPart() {
if(!preTOff) {
//Wait
preTakeOff();
preTOff = true;
}
}
//I then have the following method for the wait
public IEnumerator preTakeOff() {
print("before");
//Play particle flame
//Play particle smoke
yield return new WaitForSeconds(2);
print("after");
introState = IntroState.End;
}
It just seems to pause forever and doesn't print either "before" or "after"? The method works fine when I make it a normal method so its being called.
Any thoughts?
Have I got the setup right? All I'm trying to do is make the script wait for 2 seconds before it starts the next part of the intro.