- Home /
Syntax error on FollowPath
I'm following a youtube tutorial on making a simple stealth game, it's for an assignment that's due Saturday. I've followed everything to a T and haven't had any problems until now.
any idea what is causing mine to get an error? I've looked over the entire line of code almost 10 times and everything is exactly as in the video. Yet I'm getting this error every time. Any help would be appreciated. I'm running out of time

Answer by bhavinbhai2707 · Jan 18, 2018 at 03:01 AM
IEnumerator needs a return type
So simply return a yield in follow path function like
IEnumerator followPath()
{
//If you wanna stop the script for few seconds
Yield return new waitforseconds(float time);
// Or, simply return
Yield return 1;
}
Answer by Propagant · Jan 18, 2018 at 06:02 AM
yield return null; for C#. Or yield return new WaitForEndOfFrame();
Your answer
Follow this Question
Related Questions
How to begin startcoroutine (IEnumerator) with UI button. 1 Answer
How to send a signal when a runtime navmesh is created? 0 Answers
Unity while loop causing freezes on play 2 Answers
Adding dynamic, "glowing" links/vectors between collectibles 0 Answers
How can I make a simple sprite that I can stretch for different platforms? 1 Answer