Basically, I’m trying to chop down trees using AI. I have multiple objects in the scene with the same name, but the tag “tree”.
My pathfinding finds the closest object with the tag “tree” and walks over to it. Now, I need to check if the tree he is near has fallen. My logic is to access the script attached to the closest tree and run a function to check this status.
My question is, if I use GameObject.FindGameObjectWithTag(“Tree”) and assign that to a new GameObject, how can I access the individual script within this GameObject and not all scripts attached to the general tree prefabs?