I just wanted to check whether I was going about this in the correct way.
I have a collider.. when a gameobject with a particular tag hits it, I want to do something..all fine, nothing wrong with it. it's what I'm trying to do that's going wrong.
What I want to do is find all game objects with a tag, then enable and disable some scripts within it.
You must iterate through all the GameObjects returned by FindGameObjectsWithTag and find and disable the component on each GameObject separately
for (o : GameObject in GameObject.FindGameObjectsWithTag("coastforest"))
{
comp : Component = o.GetComponent("SeekSteer");
//Only try to disable the component if it exists on the current GameObject
if (comp != null)
{
comp.enabled = false;
}
}
Okay, I've gone another way to get the same result...
It's definitely not the most beautiful,elegant, efficient script that there is...but it's a lot more efficient to how I used to have things... My brain is so fried at the moment, that if it works, and works well enough, then it's good enough!