How to solve following the error for the script ?


error for
Assets/Script/EnemyAI.cs(57,35): error CS0029: Cannot implicitly convert type UnityEngine.GameObject[]' to UnityEngine.GameObject’

error for
Assets/Script/EnemyAI.cs(75,4): error CS1622: Cannot return a value from iterators. Use the yield return statement to return a value, or yield break to end the iteration

in the first error you are trying equalate a list with a gameobject.

like -->listname = somegameobject; (you have to do like listname[index] = somegameobject;

second error

you are calling a coroutine function with out returning ;

add yield return null in last statement of your coroutine.