- Home /
Error CS0117
"Assets/Standard Assets/Scripts/Targetting.cs(19,46): error CS0117: UnityEngine.GameObject' does not contain a definition for FindGameObjectsWhitTag'"
Need help with that error.
My code:
.
.
using UnityEngine; using System.Collections; using System.Collections.Generic;
public class Targetting : MonoBehaviour { public List targets;
// Use this for initialization
void Start () {
targets = new List();
AddAllEnemies();
}
public void AddAllEnemies()
{
GameObject[] go = GameObject.FindGameObjectsWhitTag("Enemy");
foreach(GameObject enemy in go)
AddTarget(enemy.transform);
}
public void AddTarget(Transform enemy)
{
targets.Ass(enemy);
}
// Update is called once per frame
void Update () {
}
}
Answer by Kuminalle · Apr 01, 2013 at 06:52 AM
Sorry I was just writed "with" wrong :P
So that was the solution to your problem. It is good you found it. Bbt you really need to watch your spelling, this is where most problems will come if you simply don't spell correctly. For example, I'm sure this line also doesn't work :
targets.Ass(enemy);
I think you mean Add :P
Your answer
Follow this Question
Related Questions
BlockBreaker Tutorial: CS0120 Error. 0 Answers
error CS0117: `Time' does not contain a definition for `deltaTime' 1 Answer
Ui Canvas/Error CS0117 0 Answers
Unity isn't compiling standard api calls? 2 Answers
Unity Detonator Package error 1 Answer