Start() as an IEnumerator or StartCoroutine(Start())

Hi. I did a bit of a research about this, but didn’t come with any great answers. What is the advantage of turning Start() into a coroutine instead of creating a new IEnumerator functions and calling it from the Start() method?
eg. instead of writing IEnumerator Start(), it would be void Start() as usual, but inside of it, call a coroutine that do the same thing

Hi,

That’s a good question. An advantage could be that the Start coroutine just gets started by Unity. We don’t have to do that manually. Whether you regard this as an advantage is a matter of personal preference, though. Your alternative is fine.

Since this is a course, Rick wants to teach a variety of techniques to show students the features of Unity. Not everything he does must be done this way. In many cases, there are multiple ways to make something work in Unity.

Has your question been answered? :slight_smile:


See also:

2 Likes

Yes, thanks Nina!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms