foreach (GameObject target in targets)
{
objCount++;
Animator targetAnimator = targets.GetComponent<Animator>();
if (targetAnimator.GetInteger("Hit") == 1)
{
hitTargets++;
}
}
Error: CS1579 foreach statement cannot operate on variables of type 'GameObject' because 'GameObject' does not contain a public instance or extension definition for 'GetEnumerator'