The analyzer has detected a suspicious call to a coroutine-like method in a Unity script the return value of which isn't used. To start coroutine, use the 'StartCoroutine' method.
Take a look at an example:
class CustomComponent: MonoBehaviour
{
IEnumerator ExampleCoroutine()
{
....
yield return null;
....
}
void Start()
{
....
ExampleCoroutine();
....
}
}
In this case, the 'ExampleCoroutine' coroutine code is not executed because the 'IEnumerator' object returned as a result of the call is not used in any way. To fix the issue, pass it to the 'MonoBehaviour.StartCoroutine' method:
void Start()
{
....
StartCoroutine(ExampleCoroutine());
....
}
Additional links
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders:
Take
a chance!