Can Unity print an error when you try to call a coroutine without StartCoroutine?

Silly question, but this is probably my most common coding oversight. Many times I try to call a coroutine like a normal method, and I spend a couple minutes figuring out why it isn’t running.

Is there any roundabout way to display some kind of error when this happens? Does anything even happen under the hood when you call a coroutine without StartCoroutine?

You could probably use static code analysis to find such errors.

Check out this library: GitHub - vad710/UnityEngineAnalyzer: Roslyn Analyzer for Unity3D

1 Like