Thanks for checking out my question! The code in my RTS game is made to take all gameobjects (armyguys) and check if they are inside the box I make with holding down the mouse, if so it will follow on my next mouse press. Now the code:
public void SelectArea ()
{
GameObject[] Bot = GameObject.FindGameObjectsWithTag("BlueTeam");
foreach(GameObject Body in Bot)
{
if(InRangeOfTargets(Body.transform))
Body.GetComponent<MineBotAI>().target.GetComponent<Selected>.cantransport = false;
}
}
As you probably see I’m trying to get a gameobject(target) within another gameobject and then change a public boolean, cantransport. And I get the following error message:
Assets/Scripts/TargetMover.cs(126,71): error CS0119: Expression denotes a method group', where a variable’, value' or type’ was expected