error CS0030: Cannot convert type UnityEngine.GameObject' to int’
Code:
public GameObject[] enemies; //dragged 6 GameObjects into Inspector
void OnTriggerEnter(Collider collider)
{
//activate enemies
foreach (int i in enemies) //the line the error is pointing to
{
//enemies*.active = true; *
The instruction foreach loops through all elements in the group using internal pointers or indexes; you just supply a variable of the correct type, and foreach assigns to it a new element each iteration.