﻿# V3206\. Unity Engine\. A direct call to the coroutine\-like method will not start it\. Use the 'StartCoroutine' method instead\.

Анализатор обнаружил подозрительный вызов в Unity\-скрипте метода, похожего на coroutine, возвращаемое значение которого не используется\. Для запуска coroutine нужно использовать метод 'StartCoroutine'\.

Рассмотрим пример:



```cpp
class CustomComponent: MonoBehaviour
{
  IEnumerator ExampleCoroutine()
  {
    ....
    yield return null;
    ....
  }

  void Start()
  {
    ....
    ExampleCoroutine();
    ....
  }
}
```

В данном случае код coroutine 'ExampleCoroutine' выполняться не будет, т\. к\. возвращаемый в результате вызова объект 'IEnumerator' никак не используется\. Чтобы решить проблему, нужно передать его в метод 'MonoBehaviour\.StartCoroutine':

```cpp
void Start()
{
  ....
  StartCoroutine(ExampleCoroutine());
  ....
}
```

**Дополнительные ссылки**

1. Unity Documentation\. [Coroutines](https://docs.unity3d.com/Manual/Coroutines.html)\.
1. Unity Documentation\. [MonoBehaviour\.StartCoroutine](https://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html)\.