Hi fellow Uniters, i’ve run into a little problem here. Any help would be greatly appreciated. I’m trying to instantiate an enemy combatant and have it fill in the enemyCount array. Here’s my code so far:
using UnityEngine;
using System.Collections;
public class Enemy : MonoBehaviour
{
public GameObject enemyCombatant;
public int[] enemyCount;
public int maxEnemies = 5;
void Start ()
{
enemyCount = new int[maxEnemies];
}
void FixedUpdate ()
{
for (int numberOfEnemies = 0; numberOfEnemies <= maxEnemies; numberOfEnemies++)
{
GameObject enemyCombatantClone = Instantiate(enemyCombatant, new Vector3(40, 2, 0), Quaternion.identity) as GameObject;
}
}
}