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
Answer by goutham12 · Jan 27, 2017 at 11:56 AM
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.
Attachments are easy to miss... The first error is because of this line
GameObject sResult = GameObject.FindGameObjectsWithTag ("Player");
You can't assign an array of GameObjects into a GameObject variable.
Use FindGameObjectWithTag, not the plural version
Your answer
Follow this Question
Related Questions
TypeWriter effect on existing dialogue system? 0 Answers
how to generate different level environments for a side scrolling endless runner 0 Answers
How do I edit clear flags 0 Answers
2D Circle Collider Starting Position Negating Physics Body 1 Answer
How do I play an audio clip when my character goes past a certain y level? 0 Answers