I have used the following code in my GameManager script to instantiate 20 clones of a prefab called Agent.
for (int i = 0; i < agentsTotal; i++)
{
Instantiate(agent);
agent.name = "Agent" + i;
}
I have used the agent.name line resulting in different names of the 20 clones.
I attached a script to the Agent prefab called Agent.
I have tried many things to change a bool of only one of the Agents. This should be done in the Start() part of the GameManager code but it looks like I am only able to change the bool in all clones or in no clone at all.
Can someone please point me into the right direction?